This commit is contained in:
thinkphp
2017-07-06 18:01:15 +08:00
parent 094dde5d8d
commit 7445dce2e8

View File

@@ -1132,7 +1132,7 @@ 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) {
if ((empty($a) || empty($b)) && $a !== $b) {
return 1;
}
return is_object($a) || $a != $b ? 1 : 0;