mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
改进Model类的save方法
This commit is contained in:
@@ -680,7 +680,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$where = $this->updateWhere;
|
||||
}
|
||||
|
||||
if (!empty($where)) {
|
||||
$pk = $this->getPk();
|
||||
if (is_string($pk) && isset($data[$pk])) {
|
||||
if (!isset($where[$pk])) {
|
||||
@@ -689,7 +688,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
}
|
||||
unset($data[$pk]);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->db()->where($where)->update($data);
|
||||
// 清空change
|
||||
|
||||
Reference in New Issue
Block a user