From 62f8468cc82df34adeb6d609022c76b3f1e3757e Mon Sep 17 00:00:00 2001 From: XiMo-210 <2831802697@qq.com> Date: Mon, 14 Aug 2023 00:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=B1=E7=89=A9=E6=8B=9B?= =?UTF-8?q?=E9=A2=86=E8=8E=B7=E5=8F=96=E5=85=A8=E9=83=A8=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lostAndFoundRecordServices/lostAndFoundRecordService.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/lostAndFoundRecordServices/lostAndFoundRecordService.go b/app/services/lostAndFoundRecordServices/lostAndFoundRecordService.go index 12929c1..e97fc02 100644 --- a/app/services/lostAndFoundRecordServices/lostAndFoundRecordService.go +++ b/app/services/lostAndFoundRecordServices/lostAndFoundRecordService.go @@ -13,7 +13,8 @@ func GetAllLostAndFoundRecord(campus, kind string, pageNum, pageSize int) ([]mod result := database.DB.Where(models.LostAndFoundRecord{ Campus: campus, Kind: kind, - }).Not("is_processed", true).Limit(pageSize).Offset((pageNum - 1) * pageSize).Find(&record) + }).Not("is_processed", true).Limit(pageSize).Offset((pageNum - 1) * pageSize). + Order("publish_time desc").Find(&record) if result.Error != nil { return nil, result.Error }