From 647227f3b5b25358fdacce756a8e3d411487f448 Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 29 Sep 2025 11:35:36 +0800 Subject: [PATCH] =?UTF-8?q?Updata=EF=BC=9A=E6=A0=B9=E6=8D=AE=E8=B7=9F?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E9=97=B4=E5=80=92=E5=8F=99=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internel/dao/annualReports.go | 2 ++ internel/dao/quarterlyReports.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internel/dao/annualReports.go b/internel/dao/annualReports.go index a8ef5db..19c4c68 100644 --- a/internel/dao/annualReports.go +++ b/internel/dao/annualReports.go @@ -22,6 +22,8 @@ func (annualReportsDao) List(req *reports.GetAnnualReportListReq) (data []model. dbQuery = dbQuery.Where("status = ?", req.Filtrate.Status) } } + // 按更新时间倒序排列 + dbQuery = dbQuery.Order("updated_at DESC") //数据查询 dbQuery.Count(&total) err = dbQuery.Scopes(db.Pagination(req.Page, req.PageSize)).Find(&data).Error diff --git a/internel/dao/quarterlyReports.go b/internel/dao/quarterlyReports.go index c4ffd86..40742c9 100644 --- a/internel/dao/quarterlyReports.go +++ b/internel/dao/quarterlyReports.go @@ -22,6 +22,8 @@ func (quarterlyReportsDao) List(req *reports.GetQuarterlyReportListReq) (data [] dbQuery = dbQuery.Where("status = ?", req.Filtrate.Status) } } + // 按更新时间倒序排列 + dbQuery = dbQuery.Order("updated_at DESC") dbQuery.Count(&total) err = dbQuery.Scopes(db.Pagination(req.Page, req.PageSize)).Find(&data).Error if err != nil {