巴林闲侠 1 year ago
parent
commit
f0f56352b5
  1. 10
      api/app/lib/controllers/report/index.js

10
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

Loading…
Cancel
Save