明树Git Lab

Commit 4ef055d1 authored by zengfanpei's avatar zengfanpei

update

parent 8d69e517
...@@ -54,7 +54,8 @@ async function list(req, res, next) { ...@@ -54,7 +54,8 @@ async function list(req, res, next) {
data = _.reverse(data); data = _.reverse(data);
phData = _.reverse(phData); phData = _.reverse(phData);
for (let index = 0; index < data.length; index++) { for (let index = 0; index < data.length; index++) {
const element = data[index]; let element = data[index];
element = element.toJSON();
let o = _.pick(phData[index] || {}, ['soilConductivity', 'soilConductivityUnit', 'soilPH', 'soilPHUnit']) let o = _.pick(phData[index] || {}, ['soilConductivity', 'soilConductivityUnit', 'soilPH', 'soilPHUnit'])
dataArr.push({ dataArr.push({
...o, ...o,
......
...@@ -151,7 +151,7 @@ const soilMoistureContentSchema = new Schema({ ...@@ -151,7 +151,7 @@ const soilMoistureContentSchema = new Schema({
toJSON: { toJSON: {
getters: true, getters: true,
} },
}); });
......
...@@ -18,7 +18,7 @@ async function findList(search, options) { ...@@ -18,7 +18,7 @@ async function findList(search, options) {
if(!(_.isNumber(options.skip) && _.isNumber(options.limit))) { if(!(_.isNumber(options.skip) && _.isNumber(options.limit))) {
return []; return [];
} }
return DB.CollectSMC.find(search).skip(options.skip).limit(options.limit).sort({time:-1}).lean().exec(); return DB.CollectSMC.find(search).skip(options.skip).limit(options.limit).sort({time:-1});
} }
// 总量 // 总量
......
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