明树Git Lab

Commit 0205549e authored by zfp1's avatar zfp1

update

parent 90951ca5
......@@ -17,7 +17,9 @@ async function listDeepPlant(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.preProductName = {$regex: req.body.name}
}
const count = await DB.ProductDeep.countDocuments(search);
let list = await DB.ProductDeep.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list });
......
......@@ -17,6 +17,9 @@ async function listDirectPlant(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.productName = {$regex: req.body.name}
}
const count = await DB.ProductPlant.countDocuments(search);
let list = await DB.ProductPlant.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize);
......
......@@ -18,7 +18,9 @@ async function listPrePlant(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.preProductName = {$regex: req.body.name}
}
const count = await DB.ProductPre.countDocuments(search);
let list = await DB.ProductPre.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list });
......
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