From 79c9fb870037a9b8f4054b65109cf8fbc722b62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=BA=BF=E5=85=94?= Date: Thu, 10 Aug 2023 16:36:24 +0800 Subject: [PATCH] =?UTF-8?q?OrWhereIn=E5=8F=AF=E8=83=BD=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E7=A9=BA=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/orm.go b/orm.go index b6b89e9..752aeae 100644 --- a/orm.go +++ b/orm.go @@ -292,7 +292,10 @@ func (dba *Orm) WhereIn(needle string, hystack []interface{}) IOrm { // OrWhereIn ... func (dba *Orm) OrWhereIn(needle string, hystack []interface{}) IOrm { - return dba.OrWhere(needle, "IN", hystack) + if len(hystack) > 0 { + dba.OrWhere(needle, "IN", hystack) + } + return dba } // WhereNotIn ...