This commit is contained in:
2020-11-17 18:50:19 +08:00
parent 05f93d8e9c
commit d45a002d02
+2 -2
View File
@@ -125,7 +125,7 @@ class ActiveRecord extends BaseActiveRecord
$select = new static(); $select = new static();
$select->attributes = $attributes; $select->attributes = $attributes;
if (!$select->save()) { if (!$select->save()) {
throw new Exception($select->getLastError()); throw new Exception($select->getLastError());
} }
return $select; return $select;
} }
@@ -196,7 +196,7 @@ class ActiveRecord extends BaseActiveRecord
*/ */
public static function insertOrUpdate(array $params, array $condition) public static function insertOrUpdate(array $params, array $condition)
{ {
$first = static::findOrCreate($params, $condition); $first = static::findOrCreate($condition, $params);
$first->attributes = $params; $first->attributes = $params;
if (!$first->save()) { if (!$first->save()) {
return false; return false;