Fix where_in is wiping previous where/and/or.

For now, works as an AND, but maybe later, same as where will exists
new methods: AndIn and OrIN.
This commit is contained in:
KJ 2024-08-30 16:26:03 -04:00
parent df424ffab5
commit 3d2a607768
1 changed files with 7 additions and 2 deletions

View File

@ -581,9 +581,14 @@ class Model {
}
if ($in)
static::$querySelect['where'] = "$column IN (".join(', ', $arrIn).")";
$where_in = "$column IN (".join(', ', $arrIn).")";
else
static::$querySelect['where'] = "$column NOT IN (".join(', ', $arrIn).")";
$where_in = "$column NOT IN (".join(', ', $arrIn).")";
if (static::$querySelect['where'] == '')
static::$querySelect['where'] = $where_in;
else
static::$querySelect['where'] .= " AND $where_in";
return new static();
}