From e116ad5446272d415596bd4533c50392f4b15e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 27 Nov 2020 18:44:59 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/Orm/Condition.php b/Database/Orm/Condition.php index 931df542..616b79bd 100644 --- a/Database/Orm/Condition.php +++ b/Database/Orm/Condition.php @@ -79,15 +79,15 @@ trait Condition if (is_string($where)) { return sprintf(' WHERE %s', $where); } - $_tmp = []; + $where = array_filter($where); foreach ($where as $key => $value) { if (is_array($value)) { $value = $this->arrayMap($value); } else if (!is_numeric($key)) { $value = $key . '=' . $this->valueEncode($value); } - if (empty($value)) { + if ($value === null) { continue; } $_tmp[] = $value;