From dd132236c65ab44c8a92e0347c49f0b4ab3f4c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 10 Sep 2020 16:53:30 +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/ActiveRecord.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 33fa38a5..ac0ef23c 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -188,11 +188,8 @@ class ActiveRecord extends BaseActiveRecord * @return bool|static * @throws Exception */ - public static function insertOrUpdate(array $params, array $condition = []) + public static function insertOrUpdate(array $condition, array $params) { - if (empty($condition)) { - $condition = $params; - } $first = static::findOrCreate($condition, $params); $first->attributes = $params; if (!$first->save()) {