明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
letian_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengfanpei
letian_backend
Commits
ef28bd7e
Commit
ef28bd7e
authored
Dec 06, 2024
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
09e5f791
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
plantContoller.js
controller/plantContoller.js
+3
-1
letianPlantPlan.js
db/models/letianPlantPlan.js
+18
-6
No files found.
controller/plantContoller.js
View file @
ef28bd7e
...
...
@@ -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
});
...
...
db/models/letianPlantPlan.js
View file @
ef28bd7e
...
...
@@ -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',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment