From 27a522fbeb83f93ce13d00e59fa329b68a6aeebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 20 Sep 2024 16:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=92=E5=BA=8F=E9=80=BB?= =?UTF-8?q?=E8=BE=91BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base.go b/base.go index e999454..ade1180 100644 --- a/base.go +++ b/base.go @@ -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 语句