mirror of
https://gitee.com/blackfox/geekai.git
synced 2024-12-04 21:27:39 +08:00
feat: change order by for login log and reward records
This commit is contained in:
parent
0f8a0f89e3
commit
aa376f1737
@ -24,7 +24,7 @@ func NewRewardHandler(app *core.AppServer, db *gorm.DB) *RewardHandler {
|
||||
|
||||
func (h *RewardHandler) List(c *gin.Context) {
|
||||
var items []model.Reward
|
||||
res := h.db.Find(&items)
|
||||
res := h.db.Order("id DESC").Find(&items)
|
||||
var rewards = make([]vo.Reward, 0)
|
||||
if res.Error == nil {
|
||||
userIds := make([]uint, 0)
|
||||
|
@ -204,7 +204,7 @@ func (h *UserHandler) LoginLog(c *gin.Context) {
|
||||
h.db.Model(&model.UserLoginLog{}).Count(&total)
|
||||
offset := (page - 1) * pageSize
|
||||
var items []model.UserLoginLog
|
||||
res := h.db.Offset(offset).Limit(pageSize).Find(&items)
|
||||
res := h.db.Offset(offset).Limit(pageSize).Order("id DESC").Find(&items)
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, "获取数据失败")
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user