明树Git Lab

Commit 3b188772 authored by zfp1's avatar zfp1

update

parent edddfb0d
...@@ -82,7 +82,11 @@ async function getTraceCode(req, res, next) { ...@@ -82,7 +82,11 @@ async function getTraceCode(req, res, next) {
let sourceId = traccode.source; let sourceId = traccode.source;
let source = null; let source = null;
if(traccode.type && traccode.type == 1) { if(traccode.type && traccode.type == 1) {
source = await DB.ProductPlant.findOne({_id: sourceId}).populate({path: "productPhotos"}).populate({path: "plantPlan"}).populate({path: "plantPlan.land"}); source = await DB.ProductPlant.findOne({_id: sourceId}).populate({path: "productPhotos"}).populate({path: "plantPlan"});
if(source && source.plantPlan && source.plantPlan.land) {
let devices = await Device.find({land: {$in: source.plantPlan.land}});
source.devices = devices;
}
} else if(traccode.type && traccode.type == 2) { } else if(traccode.type && traccode.type == 2) {
source = await DB.ProductPre.findOne({_id: sourceId}); source = await DB.ProductPre.findOne({_id: sourceId});
} else if(traccode.type && traccode.type == 3) { } else if(traccode.type && traccode.type == 3) {
......
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