明树Git Lab

Commit 90951ca5 authored by zfp1's avatar zfp1

update

parent 50a33465
......@@ -3,7 +3,7 @@ async function createDeepPlant(req, res, next) {
try {
//
const body = req.body;
let count = await DB.ProductDeep.count(); //没有真实删除 永远递增
let count = await DB.ProductDeep.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
let ret = await DB.ProductDeep.create(body);
res.sendData(ret);
......
......@@ -3,7 +3,7 @@ async function createDirectPlant(req, res, next) {
try {
//
const body = req.body;
let count = await DB.ProductPlant.count(); //没有真实删除 永远递增
let count = await DB.ProductPlant.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
let ret = await DB.ProductPlant.create(body);
res.sendData(ret);
......
......@@ -4,7 +4,7 @@ async function createPrePlant(req, res, next) {
try {
//
const body = req.body;
let count = await DB.ProductPre.count(); //没有真实删除 永远递增
let count = await DB.ProductPre.countDocuments(); //没有真实删除 永远递增
body.productNumber = count;
let ret = await DB.ProductPre.create(body);
res.sendData(ret);
......@@ -20,7 +20,7 @@ async function listPrePlant(req, res, next) {
let skip = (page - 1) * pageSize;
const count = await DB.ProductPre.countDocuments(search);
let list = await DB.ProductPre.find(search).populate({pat: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize);
let list = await DB.ProductPre.find(search).populate({path: "productPhotos"}).sort({_id: -1}).skip(skip).limit(pageSize);
res.sendData({ count, list });
} catch (error) {
next(error);
......
......@@ -101,7 +101,7 @@ const cron = () => {
if (sysConfig && sysConfig.cron && sysConfig.cron.plantearlywarning) {
console.log("plant:", new Date());
new nodeCron.schedule('1 01 06 * * *', async () => {
new nodeCron.schedule('1 */1 * * * *', async () => {
await plantWarnCron.plantearlywarning();
}, { timezone: "Asia/Shanghai" });
}
......
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