From df9e8eb0c519d8b3bd5f56988cc2acb9541f3cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 9 Aug 2021 18:36:56 +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/Traits/QueryTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Database/Traits/QueryTrait.php b/Database/Traits/QueryTrait.php index 605aec91..6cac5c01 100644 --- a/Database/Traits/QueryTrait.php +++ b/Database/Traits/QueryTrait.php @@ -15,6 +15,7 @@ use Database\ActiveQuery; use Database\ActiveRecord; use Database\Condition\MathematicsCondition; use Database\Query; +use Database\SqlBuilder; use Exception; use ReflectionException; use Snowflake\Exception\NotFindClassException; @@ -505,7 +506,10 @@ trait QueryTrait if ($conditionArray instanceof Closure) { $conditionArray = $this->makeClosureFunction($conditionArray); } - $this->where = ['or', $conditionArray]; + + $oldWhere = SqlBuilder::builder((new Query())->where($this->where))->getCondition(); + + $this->where = ['or', $conditionArray, $oldWhere]; return $this; }