改进Model类一处bug

This commit is contained in:
thinkphp
2016-09-02 11:11:07 +08:00
parent 1430cd1da1
commit 62cb8165f3

View File

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