mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正isUpdate方法
This commit is contained in:
@@ -363,8 +363,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
}
|
}
|
||||||
$result = $db->update($this->data);
|
$result = $db->update($this->data);
|
||||||
|
|
||||||
// 清空change
|
|
||||||
$this->change = [];
|
|
||||||
// 更新回调
|
// 更新回调
|
||||||
$this->trigger('after_update', $this);
|
$this->trigger('after_update', $this);
|
||||||
} else {
|
} else {
|
||||||
@@ -393,6 +391,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
|
|
||||||
// 标记为更新
|
// 标记为更新
|
||||||
$this->isUpdate = true;
|
$this->isUpdate = true;
|
||||||
|
// 清空change
|
||||||
|
$this->change = [];
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param bool $update
|
* @param bool $update
|
||||||
* @return Model
|
* @return Model
|
||||||
*/
|
*/
|
||||||
protected function isUpdate($update = true)
|
public function isUpdate($update = true)
|
||||||
{
|
{
|
||||||
$this->isUpdate = $update;
|
$this->isUpdate = $update;
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
Reference in New Issue
Block a user