明树Git Lab

Commit c91bc3eb authored by zfp1's avatar zfp1

update

parent 0205549e
...@@ -21,7 +21,7 @@ async function listDeepPlant(req, res, next) { ...@@ -21,7 +21,7 @@ async function listDeepPlant(req, res, next) {
search.preProductName = {$regex: req.body.name} search.preProductName = {$regex: req.body.name}
} }
const count = await DB.ProductDeep.countDocuments(search); const count = await DB.ProductDeep.countDocuments(search);
let list = await DB.ProductDeep.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize); let list = await DB.ProductDeep.find(search).populate({path: "productPhotos"}).populate({path: "sourcePlantProduct"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list }); res.sendData({ count, list });
} catch (error) { } catch (error) {
next(error); next(error);
......
...@@ -22,7 +22,7 @@ async function listDirectPlant(req, res, next) { ...@@ -22,7 +22,7 @@ async function listDirectPlant(req, res, next) {
} }
const count = await DB.ProductPlant.countDocuments(search); const count = await DB.ProductPlant.countDocuments(search);
let list = await DB.ProductPlant.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize); let list = await DB.ProductPlant.find(search).populate({path: "productPhotos"}).populate({path: "plantPlan"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list }); res.sendData({ count, list });
} catch (error) { } catch (error) {
next(error); next(error);
......
...@@ -22,7 +22,7 @@ async function listPrePlant(req, res, next) { ...@@ -22,7 +22,7 @@ async function listPrePlant(req, res, next) {
search.preProductName = {$regex: req.body.name} search.preProductName = {$regex: req.body.name}
} }
const count = await DB.ProductPre.countDocuments(search); const count = await DB.ProductPre.countDocuments(search);
let list = await DB.ProductPre.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize); let list = await DB.ProductPre.find(search).populate({path: "productPhotos"}).populate({path: "sourcePlantProduct"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list }); res.sendData({ count, list });
} catch (error) { } catch (error) {
next(error); next(error);
......
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