Skip to content

Commit

Permalink
修正WhereIn参数不全的时候会导致的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
tobycroft committed Mar 7, 2023
1 parent ca7b835 commit 890b170
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
Expand Down

0 comments on commit 890b170

Please sign in to comment.