From 35466cf69f763421ff59b6c379c9a230f3be24e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 24 Feb 2021 18:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Orm/Condition.php | 7 ++----- Database/Traits/QueryTrait.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Database/Orm/Condition.php b/Database/Orm/Condition.php index 113e1398..765f1a73 100644 --- a/Database/Orm/Condition.php +++ b/Database/Orm/Condition.php @@ -81,13 +81,10 @@ trait Condition $_tmp = []; if (empty($where)) return ''; + var_dump($where); foreach ($where as $key => $value) { - if (is_string($key)) { - $_tmp = $this->conditionMap([$key, $value]); - break; - } - $_value = is_string($value) ? $value : $this->conditionMap($value); + if (empty($_value)) continue; $_tmp[] = $_value; diff --git a/Database/Traits/QueryTrait.php b/Database/Traits/QueryTrait.php index c8e42c57..5422c31b 100644 --- a/Database/Traits/QueryTrait.php +++ b/Database/Traits/QueryTrait.php @@ -730,7 +730,7 @@ trait QueryTrait */ public function where(callable|array|string $conditions): static { - $this->where[] = $conditions; + $this->where[] = [$conditions]; return $this; }