From a1dbd74f50d9b0b935ecb412b116b8c96fe0e1ac Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 30 Jul 2022 15:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F-=E5=B7=A1=E6=9F=A5?= =?UTF-8?q?=E5=85=BB=E6=8A=A4=E5=88=97=E8=A1=A8=E5=BB=BA=E8=AE=AE=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E4=B8=8A=E6=8A=A5=E6=97=B6=E9=97=B4=E9=99=8D=E5=BA=8F?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index bbaf89c6..c7aa1d18 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -1,7 +1,7 @@ 'use strict'; const { QueryTypes } = require('sequelize'); -async function reportList(ctx) { +async function reportList (ctx) { try { const models = ctx.fs.dc.models; const { limit, page, startTime, endTime, keyword, userId, reportType, isTop } = ctx.query @@ -14,6 +14,7 @@ async function reportList(ctx) { model: models.User, attributes: ['name'] }], + order: [['time', 'DESC']], } if (limit) { findOption.limit = limit @@ -60,7 +61,7 @@ async function reportList(ctx) { } } -async function reportPosition(ctx) { +async function reportPosition (ctx) { try { const models = ctx.fs.dc.models; const { startTime, endTime, userId, reportType } = ctx.query @@ -110,7 +111,7 @@ async function reportPosition(ctx) { } } -async function reportDetail(ctx) { +async function reportDetail (ctx) { try { const models = ctx.fs.dc.models; const { reportId } = ctx.params @@ -132,7 +133,7 @@ async function reportDetail(ctx) { } } -async function createReport(ctx) { +async function createReport (ctx) { try { const { userId } = ctx.fs.api const models = ctx.fs.dc.models; @@ -154,7 +155,7 @@ async function createReport(ctx) { } } -async function deleteReport(ctx) { +async function deleteReport (ctx) { try { const models = ctx.fs.dc.models; const { reportId } = ctx.params;