明树Git Lab

Commit ef28bd7e authored by zfp1's avatar zfp1

update

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