From 164b7521c57bffb4a7a2496285a00bb5be88a8e1 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 1 Apr 2017 10:59:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BsetAttr=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 976823aa..d3e8e99d 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -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, $data); + $value = $this->$method($value, array_merge($this->data, $data)); } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->writeTransform($value, $this->type[$name]);