diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 0119c34f..5bb931bd 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -401,9 +401,9 @@ async function spotCheck (ctx) { let findUsers = [] findUsers = userRes.map(item => { return item.id - }) - let checkCount = Math.ceil(prepareRes.reportCount * (prepareRes.percentage / 100)) - + }) + let checkCount = Math.ceil(prepareRes.reportCount * (prepareRes.percentage / 100)) + const reportRes = findUsers.length && checkCount ? await models.Report.findAll({ where: { reportType: 'conserve', @@ -440,7 +440,7 @@ async function spotCheck (ctx) { ctx.body = reportRes } catch (error) { await transaction.rollback(); - ctx.fs.logger.error(`path: ${ctx.path}, error: error`); + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; ctx.body = { message: typeof error == 'string' ? error : undefined @@ -469,7 +469,7 @@ async function spotCheckDetail (ctx) { ctx.body = res ctx.status = 200 } catch (error) { - ctx.fs.logger.error(`path: ${ctx.path}, error: error`) + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`) ctx.status = 400 ctx.body = { message: typeof error == 'string' ? error : undefined