明树Git Lab

Commit ef28bd7e authored by zfp1's avatar zfp1

update

parent 09e5f791
......@@ -14,7 +14,9 @@ async function listPlantCycle(req, res, next) {
let page = req.body.page || 1;
let pageSize = req.body.pageSize || 10;
let skip = (page - 1) * pageSize;
if(req.body.name) {
search.name = req.body.name;
}
const count = await DB.PlantCycle.countDocuments(search);
let list = await DB.PlantCycle.find(search).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list });
......
......@@ -11,23 +11,35 @@ const PlantPlanSchema = new Schema({
type: String,
comment: "作物类型",
},
plantVariety: {
type: mongoose.Types.ObjectId,
ref: 'PlantVariety',
comment: "作物种类"
palntName: {
type: String,
comment: "作物名称",
},
// plantVariety: {
// type: mongoose.Types.ObjectId,
// ref: 'PlantVariety',
// comment: "作物种类"
// },
// land: {
// type: String,
// comment: "种植位置",
// },
plantArea: {
type: String,
type: Number,
comment: "种植面积",
},
estimatedYield: {
plantAreaUnit: {
type: String,
comment: "种植面积单位",
},
estimatedYield: {
type: Number,
comment: "预计产量",
},
estimatedYieldUnit: {
type: String,
comment: "预计产量单位",
},
// zone: {
// type: mongoose.Types.ObjectId,
// ref: 'Zone',
......
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