This commit is contained in:
duyu 2024-07-18 15:27:38 +08:00
parent ac1a0c70c7
commit cc8409028e
4 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ func (m *merchantModel) Search(id int64, name string, startTime string, endTime
sql += " and created_at >= ? and created_at <= ?"
args = append(args, startTime, endTime)
}
err = m.GetDb().Where(sql, args...).Limit(limit, page).Find(&merchant)
err = m.GetDb().Where(sql, args...).OrderBy("created_at").Desc().Limit(limit, page).Find(&merchant)
return
}

View File

@ -145,7 +145,7 @@ func (m *ordersModel) Search(
sql += " and created_at >= ? and created_at <= ?"
args = append(args, startTime, endTime)
}
err = m.GetDb().Where(sql, args...).Limit(limit, page).Find(&orders)
err = m.GetDb().Where(sql, args...).OrderBy("created_at").Desc().Limit(limit, page).Find(&orders)
return
}

View File

@ -80,7 +80,7 @@ func (m *productModel) Search(id int64, name string, startTime string, endTime s
sql += " and created_at >= ? and created_at <= ?"
args = append(args, startTime, endTime)
}
err = m.GetDb().Where(sql, args...).Limit(limit, page).Find(&product)
err = m.GetDb().Where(sql, args...).OrderBy("created_at").Desc().Limit(limit, page).Find(&product)
return
}

View File

@ -91,7 +91,7 @@ func (m *whitelistModel) Search(id int64, merchant_id int64, ip string, startTim
sql += " and created_at >= ? and created_at <= ?"
args = append(args, startTime, endTime)
}
err = m.GetDb().Where(sql, args...).Limit(limit, page).Find(&whitelist)
err = m.GetDb().Where(sql, args...).OrderBy("created_at").Desc().Limit(limit, page).Find(&whitelist)
return
}