feat:2、数据显示优化

This commit is contained in:
2026-10-30 16:13:39 +08:00
parent ea46700fe2
commit a7f8f9c639
4 changed files with 607 additions and 21 deletions
+2 -3
View File
@@ -412,9 +412,8 @@ func (s *RockService) ListTokens(ctx context.Context, page, pageSize int, status
}
var tokens []model.RockToken
// 按包 ID 倒序(未打包的手工采购记录排在最后),同包内按本地 ID 倒序,保证分页稳定
err := db.Order("package_id DESC NULLS LAST").
Order("id DESC").
// 按本地 ID 倒序:ID 自增,等价于按入库时间倒序;分页稳定,且与列表首列 ID 的降序一致
err := db.Order("id DESC").
Offset((page - 1) * pageSize).
Limit(pageSize).
Find(&tokens).Error