From d45a002d025cd0d83be946efb45c068efc906f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 17 Nov 2020 18:50:19 +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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 2e20ad70..515a198f 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -125,7 +125,7 @@ class ActiveRecord extends BaseActiveRecord $select = new static(); $select->attributes = $attributes; if (!$select->save()) { - throw new Exception($select->getLastError()); + throw new Exception($select->getLastError()); } return $select; } @@ -196,7 +196,7 @@ class ActiveRecord extends BaseActiveRecord */ public static function insertOrUpdate(array $params, array $condition) { - $first = static::findOrCreate($params, $condition); + $first = static::findOrCreate($condition, $params); $first->attributes = $params; if (!$first->save()) { return false;