修正保存的时候 主键更改的问题~

This commit is contained in:
thinkphp
2016-04-01 12:31:13 +08:00
parent e95b98b3a3
commit 732ddff179

View File

@@ -202,6 +202,7 @@ class Model
if (!empty($this->data)) {
// 没有传递数据,获取当前数据对象的值
$data = $this->data;
$find = true;
// 重置数据
$this->data = [];
} else {
@@ -219,7 +220,7 @@ class Model
if (empty($data)) {
// 没有数据变化
return [];
} else {
} elseif (!empty($find)) {
// 更新操作保留主键信息
$pk = $this->getPk();
if (is_array($pk)) {