diff --git a/library/think/Model.php b/library/think/Model.php index e5a107f8..02cb6854 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -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]);