明树Git Lab

Commit ce067829 authored by zfp1's avatar zfp1

update

parent 5fc762de
...@@ -91,7 +91,7 @@ async function listPlan(req, res, next) { ...@@ -91,7 +91,7 @@ async function listPlan(req, res, next) {
let skip = (page - 1) * pageSize; let skip = (page - 1) * pageSize;
const count = await DB.PlantPlan.countDocuments(search); const count = await DB.PlantPlan.countDocuments(search);
let list = await DB.PlantPlan.find(search).populate({path: 'plantiCycle'}).populate({path: "land"}).sort({_id: -1}).skip(skip).limit(pageSize); let list = await DB.PlantPlan.find(search).populate({path: 'plantCycle'}).populate({path: "land"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list }); res.sendData({ count, list });
} catch (error) { } catch (error) {
next(error); next(error);
......
...@@ -63,5 +63,5 @@ const PlantCycleSchema = new Schema({ ...@@ -63,5 +63,5 @@ const PlantCycleSchema = new Schema({
}); });
const PlantCycle = mongoose.model('letianPlantCycle', PlantCycleSchema, 'letianPlantCycle'); const PlantCycle = mongoose.model('PlantCycle', PlantCycleSchema, 'letianPlantCycle');
module.exports = PlantCycle; module.exports = PlantCycle;
\ No newline at end of file
...@@ -54,7 +54,7 @@ const PlantPlanSchema = new Schema({ ...@@ -54,7 +54,7 @@ const PlantPlanSchema = new Schema({
type: String, type: String,
comment: "种植状态 采收、结束种植", comment: "种植状态 采收、结束种植",
}, },
plantiCycle: { plantCycle: {
type: [mongoose.Types.ObjectId], type: [mongoose.Types.ObjectId],
// type: [{ // type: [{
// cycleName: { // cycleName: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment