mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02: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);
|
$this->autoCompleteData($this->update);
|
||||||
|
|
||||||
// 获取有更新的数据
|
|
||||||
$data = $this->getChangedData();
|
|
||||||
|
|
||||||
// 事件回调
|
// 事件回调
|
||||||
if (false === $this->trigger('before_update', $this)) {
|
if (false === $this->trigger('before_update', $this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取有更新的数据
|
||||||
|
$data = $this->getChangedData();
|
||||||
|
|
||||||
if (empty($data) || (count($data) == 1 && is_string($pk) && isset($data[$pk]))) {
|
if (empty($data) || (count($data) == 1 && is_string($pk) && isset($data[$pk]))) {
|
||||||
// 关联更新
|
// 关联更新
|
||||||
if (isset($relation)) {
|
if (isset($relation)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user