改进Model的一处数据比较

This commit is contained in:
thinkphp
2016-11-29 15:53:33 +08:00
parent da3f737ccc
commit aed8be7150

View File

@@ -300,7 +300,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
}
// 标记字段更改
if (!isset($this->data[$name]) || ($this->data[$name] != $value && !in_array($name, $this->change))) {
if (!isset($this->data[$name]) || (0 !== strcmp($this->data[$name], $value) && !in_array($name, $this->change))) {
$this->change[] = $name;
}
// 设置数据对象属性