This commit is contained in:
2021-02-24 18:51:09 +08:00
parent a66b7bf450
commit 35466cf69f
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -81,13 +81,10 @@ trait Condition
$_tmp = []; $_tmp = [];
if (empty($where)) return ''; if (empty($where)) return '';
var_dump($where);
foreach ($where as $key => $value) { foreach ($where as $key => $value) {
if (is_string($key)) {
$_tmp = $this->conditionMap([$key, $value]);
break;
}
$_value = is_string($value) ? $value : $this->conditionMap($value); $_value = is_string($value) ? $value : $this->conditionMap($value);
if (empty($_value)) continue; if (empty($_value)) continue;
$_tmp[] = $_value; $_tmp[] = $_value;
+1 -1
View File
@@ -730,7 +730,7 @@ trait QueryTrait
*/ */
public function where(callable|array|string $conditions): static public function where(callable|array|string $conditions): static
{ {
$this->where[] = $conditions; $this->where[] = [$conditions];
return $this; return $this;
} }