修正Model类的save方法一处bug

This commit is contained in:
thinkphp
2016-04-25 17:43:45 +08:00
parent e4f45aa0cd
commit e33a80a6b9

View File

@@ -222,9 +222,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
// 检测字段
if (!empty($this->field)) {
foreach ($data as $key => $val) {
foreach ($this->data as $key => $val) {
if (!in_array($key, $this->field)) {
unset($data[$key]);
unset($this->data[$key]);
}
}
}