This commit is contained in:
2023-04-17 10:56:35 +08:00
parent 5057135590
commit 1b65f84962
+6
View File
@@ -767,6 +767,9 @@ trait QueryTrait
$this->where[] = $column; $this->where[] = $column;
} else { } else {
[$column, $opera, $value] = $this->opera(...func_get_args()); [$column, $opera, $value] = $this->opera(...func_get_args());
if ($value === null) {
return $this;
}
$this->bindParam(':' . $column, $value); $this->bindParam(':' . $column, $value);
$this->where[] = $column . ' ' . $opera . ':' . $column; $this->where[] = $column . ' ' . $opera . ':' . $column;
} }
@@ -854,6 +857,9 @@ trait QueryTrait
private function addArray(array $array): static private function addArray(array $array): static
{ {
foreach ($array as $key => $value) { foreach ($array as $key => $value) {
if ($value === null) {
continue;
}
$this->where[] = $this->sprintf($key, $value); $this->where[] = $this->sprintf($key, $value);
} }
return $this; return $this;