|
|
@ -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; |
|
|
|