From 9b72b847563465bf9545aacc2b5bb5162d6e7320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 10 Sep 2020 16:14:22 +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/ActiveQuery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Database/ActiveQuery.php b/Database/ActiveQuery.php index 9da036e2..c55b46d6 100644 --- a/Database/ActiveQuery.php +++ b/Database/ActiveQuery.php @@ -317,9 +317,10 @@ class ActiveQuery extends Component */ public function exists() { - return (bool)$this->modelClass::getDb() + $column = $this->modelClass::getDb() ->createCommand($this->queryBuilder()) ->fetchColumn(); + return $column !== false; } /**