明树Git Lab

Commit 7ff0c0bc authored by zengfanpei's avatar zengfanpei

update

parent 3070be14
...@@ -39,13 +39,14 @@ async function list(req, res, next) { ...@@ -39,13 +39,14 @@ async function list(req, res, next) {
search.deviceNumber = {$in: devNums} search.deviceNumber = {$in: devNums}
} }
} }
search.deviceHQType = req.body.deviceHQType; search.deviceHQType = req.body.deviceHQType || 1;
let page = req.body.page || 1; let page = req.body.page || 1;
let pageSize = req.body.pageSize || 10; let pageSize = req.body.pageSize || 10;
let skip = (page - 1) * pageSize; let skip = (page - 1) * pageSize;
console.log(search);
let count = await collectSMCModule.count(search); let count = await collectSMCModule.count(search);
let data = await collectSMCModule.findList(search, { skip, limit: pageSize }); let data = await collectSMCModule.findList(search, { skip, limit: pageSize });
if(!search.deviceHQType) { // 这段是为了大屏 把 ph电导率 和 温湿度氮磷钾 合并起来 if(!req.body.deviceHQType) { // 这段是为了大屏 把 ph电导率 和 温湿度氮磷钾 合并起来
search.deviceHQType = 2; search.deviceHQType = 2;
delete search.deviceNumber; delete search.deviceNumber;
let phData = await collectSMCModule.findList(search, { skip, limit: pageSize}); let phData = await collectSMCModule.findList(search, { skip, limit: pageSize});
......
...@@ -23,7 +23,6 @@ async function findList(search, options) { ...@@ -23,7 +23,6 @@ async function findList(search, options) {
// 总量 // 总量
async function count(search) { async function count(search) {
console.log(DB.CollectSMC)
return DB.CollectSMC.countDocuments(search); return DB.CollectSMC.countDocuments(search);
} }
......
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