明树Git Lab

Commit 3d902c0b authored by zfp1's avatar zfp1

update

parent 6a05e673
......@@ -91,7 +91,7 @@ async function listPlan(req, res, next) {
let skip = (page - 1) * pageSize;
const count = await DB.PlantPlan.countDocuments(search);
let list = await DB.PlantPlan.find(search).sort({_id: -1}).skip(skip).limit(pageSize);
let list = await DB.PlantPlan.find(search).populate({path: "land"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list });
} catch (error) {
next(error);
......
......@@ -46,7 +46,7 @@ const PlantPlanSchema = new Schema({
// comment: "所属基地"
// },
land: {
type: mongoose.Types.ObjectId,
type: [mongoose.Types.ObjectId],
ref: 'Land',
comment: "地块"
},
......
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