改进Model类data方法

This commit is contained in:
thinkphp
2016-04-11 10:33:17 +08:00
parent 6acd1470ca
commit fecb446621

View File

@@ -153,6 +153,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
throw new Exception('data type invalid', 10300);
}
$this->data = $data;
// 标记字段为更改
foreach ($data as $key => $val) {
$this->change[] = $key;
}
return $this;
}