This commit is contained in:
2023-12-14 09:50:49 +08:00
parent 694028f983
commit e248bbbea0
2 changed files with 14 additions and 22 deletions
+1 -11
View File
@@ -195,17 +195,7 @@ class Model extends Base\Model
if (!$this->validator($this->rules()) || !$this->beforeSave($this)) {
return FALSE;
}
$condition = [];
$oldPrams = [];
foreach ($this->_oldAttributes as $key => $attribute) {
if (!array_key_exists($key, $params) || $params[$key] == $attribute) {
$condition[$key] = $attribute;
} else {
$oldPrams[$key] = $this->_oldAttributes[$attribute];
}
}
return $this->updateInternal($oldPrams, $condition, $params);
return $this->updateInternal(...$this->arrayIntersect($params));
}