Fix "in" operator (and more generally array values) in where clause on QueryBuilder.

This commit is contained in:
ylorant
2021-09-24 00:24:01 +02:00
parent 9211d84406
commit 4d7836f3f0

View File

@@ -285,12 +285,13 @@ class QueryBuilder
$value = '(' . implode(',', array_fill(0, count($value), '?')) . ')';
} else {
array_push($this->condition_binds, $value);
$value = "?";
}
if (empty($this->conditions) || strpos(end($this->conditions), '(') !== false) {
array_push($this->conditions, "$column $operator ?");
array_push($this->conditions, "$column $operator $value");
} else {
array_push($this->conditions, "$ao $column $operator ?");
array_push($this->conditions, "$ao $column $operator $value");
}
return $this;