From 890b17008a21f80aeda39504cfae020e319f233d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=BA=BF=E5=85=94?= Date: Tue, 7 Mar 2023 17:22:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3WhereIn=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=94=99=E8=AF=AF?= 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 f91ced6..2410fa1 100644 --- a/orm.go +++ b/orm.go @@ -278,7 +278,10 @@ func (dba *Orm) OrWhereNotRegexp(arg string, expstr string) IOrm { // WhereIn ... func (dba *Orm) WhereIn(needle string, hystack []interface{}) IOrm { - return dba.Where(needle, "IN", hystack) + if len(hystack) > 0 { + return dba.Where(needle, "IN", hystack) + } + return dba } // OrWhereIn ...