调整Model类setAttr方法

This commit is contained in:
thinkphp
2017-03-28 12:47:05 +08:00
parent 8d61c3b13e
commit a4646ba1a9
2 changed files with 2 additions and 1 deletions

View File

@@ -283,7 +283,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
// 检测修改器
$method = 'set' . Loader::parseName($name, 1) . 'Attr';
if (method_exists($this, $method)) {
$value = $this->$method($value, array_merge($data, $this->data));
$value = $this->$method($value, $data);
} elseif (isset($this->type[$name])) {
// 类型转换
$value = $this->writeTransform($value, $this->type[$name]);