改进数据更新判断

This commit is contained in:
thinkphp
2017-04-13 16:39:27 +08:00
parent 63adb4527f
commit 87b3283bd3

View File

@@ -930,7 +930,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
// 获取有更新的数据 // 获取有更新的数据
$data = array_udiff_assoc($this->data, $this->origin, function ($a, $b) { $data = array_udiff_assoc($this->data, $this->origin, function ($a, $b) {
return $a === $b ? 0 : 1; return is_object($a) || $a != $b ? 1 : 0;
}); });
if (!empty($this->readonly)) { if (!empty($this->readonly)) {