feat:order logs by time desc (#1250)

This commit is contained in:
CNCSMonster
2023-10-19 11:36:51 +08:00
committed by GitHub
parent 8a54e465a2
commit b3d2f3b182
+1
View File
@@ -24,6 +24,7 @@ func (l *LogGorm) Search(ctx context.Context, keyword string, start time.Time, e
if end.UnixMilli() != 0 {
db = l.db.WithContext(ctx).Where("create_time <= ?", end)
}
db = db.Order("create_time desc")
return ormutil.GormSearch[relationtb.Log](db, []string{"user_id"}, keyword, pageNumber, showNumber)
}