diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index 53c9547..5562e2f 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -9,8 +9,16 @@ async function getReserveItemReport(ctx, next) { order: [['year', 'DESC'], ['month', 'DESC']], where: { type: type } }) + let newReportData = rslt.map(e => { + return { + id: e.id, + date: e.year + '-' + e.month, + path: e.path, + type: e.type + } + }) ctx.status = 200 - ctx.body = rslt + ctx.body = newReportData } catch (error) { ctx.fs.logger.error(`path:${ctx.path},error:${error}`) ctx.status = 400;