From 77df474a4f1096a453b4f6c3d4f28443b8c184d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 18 Jul 2022 19:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=B9=E4=BC=A0=E5=85=A5wh?= =?UTF-8?q?ere=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.go b/base.go index 7d6a690..f12bd75 100644 --- a/base.go +++ b/base.go @@ -106,7 +106,7 @@ func (b *BaseDao) setTxCondition(tx *gorm.DB, table string, optionFuncList ...Se } // 设置where条件 - if nil != o.Where { + if nil != o.Where && len(o.Where) > 0 { tx.Where(o.Where) }