明树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
b77eba1f
Commit
b77eba1f
authored
Dec 23, 2024
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8d39aace
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
productTracController.js
controller/productTracController.js
+13
-1
letianProTraceCode.js
db/models/letianProTraceCode.js
+1
-1
No files found.
controller/productTracController.js
View file @
b77eba1f
...
...
@@ -27,7 +27,19 @@ async function listTraceCode(req, res, next) {
}
const
count
=
await
DB
.
ProTraceCode
.
countDocuments
(
search
);
let
list
=
await
DB
.
ProTraceCode
.
find
(
search
).
sort
({
_id
:
-
1
}).
skip
(
skip
).
limit
(
pageSize
);
res
.
sendData
({
count
,
list
});
let
ret
=
[];
for
(
let
index
=
0
;
index
<
list
.
length
;
index
++
)
{
const
element
=
list
[
index
];
if
(
element
.
source
&&
element
.
type
==
1
)
{
element
.
source
=
await
DB
.
ProductPlant
.
findOne
({
_id
:
element
.
source
});
}
else
if
(
element
.
source
&&
element
.
type
==
2
)
{
element
.
source
=
await
DB
.
ProductPre
.
findOne
({
_id
:
element
.
source
});
}
else
if
(
element
.
source
&&
element
.
type
==
3
)
{
element
.
source
=
await
DB
.
ProductDeep
.
findOne
({
_id
:
element
.
source
});
}
ret
.
push
(
element
);
}
res
.
sendData
({
count
,
ret
});
}
catch
(
error
)
{
next
(
error
);
}
...
...
db/models/letianProTraceCode.js
View file @
b77eba1f
...
...
@@ -14,7 +14,7 @@ const letianProTraceCodeSchema = new Schema({
manufactureDate
:
{
type
:
Date
,
default
:
Date
.
now
,
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD
HH:mm:ss
"
),
get
:
v
=>
moment
(
v
).
format
(
"YYYY-MM-DD"
),
comment
:
"生产日期"
},
type
:
{
...
...
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