Merge pull request #115 from ylorant/master

Fix "in" operator in where clause of the QueryBuilder.
This commit is contained in:
Paweł Klockiewicz
2021-09-24 11:04:11 +02:00
committed by GitHub

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;