mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
调整模型的save方法before_update检查位置
This commit is contained in:
@@ -958,14 +958,14 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
// 自动更新
|
||||
$this->autoCompleteData($this->update);
|
||||
|
||||
// 获取有更新的数据
|
||||
$data = $this->getChangedData();
|
||||
|
||||
// 事件回调
|
||||
if (false === $this->trigger('before_update', $this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取有更新的数据
|
||||
$data = $this->getChangedData();
|
||||
|
||||
if (empty($data) || (count($data) == 1 && is_string($pk) && isset($data[$pk]))) {
|
||||
// 关联更新
|
||||
if (isset($relation)) {
|
||||
|
||||
Reference in New Issue
Block a user