修复排序逻辑BUG

This commit is contained in:
白茶清欢 2024-09-20 16:43:03 +08:00
parent 4e1b8ea8fb
commit 27a522fbeb

View File

@ -254,8 +254,8 @@ func (b *BaseDao) setTxCondition(tx *gorm.DB, optionFuncList ...define.SetOption
}
// 排序
for _, orderRule := range o.Order {
tx = tx.Order(orderRule)
if len(o.Order) == 2 {
tx = tx.Order(o.Order[0] + " " + o.Order[1])
}
// or 语句