From 26b152dbb952ce9d3f8c6c4e1ccf6936faff348b Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 2 Aug 2023 23:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E6=8A=BD=E6=9F=A5=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E7=94=9F=E6=95=88=E8=8E=B7=E5=BE=97=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 0f52e751..dff093c8 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -375,8 +375,10 @@ async function spotCheck (ctx) { throw '参数错误' } - const prepareRes = await models.ReportSpotCheckPreview.find({ - id: previewId + const prepareRes = await models.ReportSpotCheckPreview.findOne({ + where: { + id: previewId + } }) const sqlStr = ` @@ -400,9 +402,7 @@ async function spotCheck (ctx) { findUsers = userRes.map(item => { return item.id }) - console.log('findUsers', findUsers) let checkCount = Math.ceil(prepareRes.reportCount * (prepareRes.percentage / 100)) - console.log('checkCount', checkCount) const reportRes = findUsers.length && checkCount ? await models.Report.findAll({ where: { reportType: 'conserve', @@ -419,7 +419,7 @@ async function spotCheck (ctx) { id: previewId } }) - console.log('reportRes', reportRes) + if (reportRes.length) { let spotDate = moment().format('YYYY-MM-DD') await models.ReportSpotCheck.bulkCreate(reportRes.map(r => {