改进废弃字段判断

This commit is contained in:
thinkphp
2017-11-28 18:46:28 +08:00
parent 1fc85442cb
commit dd24123921

View File

@@ -132,7 +132,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
if ($this->disuse) {
// 废弃字段
foreach ((array) $this->disuse as $key) {
if (isset($this->data[$key])) {
if (array_key_exists($key, $this->data)) {
unset($this->data[$key]);
}
}