Skip to content

Commit

Permalink
OrWhereIn可能存在传入空出错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tobycroft committed Aug 10, 2023
1 parent d6bdf0c commit 79c9fb8
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 @@ -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 ...
Expand Down

0 comments on commit 79c9fb8

Please sign in to comment.