修正模型数据变化判断

This commit is contained in:
thinkphp
2017-05-11 14:53:43 +08:00
parent 06f603d737
commit 7576b88c99

View File

@@ -1078,6 +1078,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
public function getChangedData()
{
$data = array_udiff_assoc($this->data, $this->origin, function ($a, $b) {
if ((empty($b) || empty($b)) && $a !== $b) {
return 1;
}
return is_object($a) || $a != $b ? 1 : 0;
});