From 6dbc18c7d935e5521dd0dccb35199967575f2ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 10 Nov 2021 11:06:01 +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 --- src/Base/Model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Base/Model.php b/src/Base/Model.php index a4561a2..6925e87 100644 --- a/src/Base/Model.php +++ b/src/Base/Model.php @@ -448,19 +448,19 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T * @return bool|int * @throws Exception */ - protected static function deleteByCondition($condition = NULL, array $attributes = [], bool $if_condition_is_null = false): bool|int + protected static function deleteByCondition($condition = NULL, array $attributes = [], bool $if_condition_is_null = false): bool { if (empty($condition)) { if (!$if_condition_is_null) { return false; } - return static::query()->delete(); + return (bool)static::query()->delete(); } $model = static::query()->ifNotWhere($if_condition_is_null)->where($condition); if (!empty($attributes)) { $model->bindParams($attributes); } - return $model->delete(); + return (bool)$model->delete(); }