From 28844c12b0434104b0da25fb54da9ce37b5ee133 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 28 Dec 2016 14:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=85=B3=E8=81=94=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=9A=84=E8=8E=B7=E5=8F=96?= 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 605d48d3..85b4cedd 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -439,7 +439,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $value = $this->readTransform($value, $this->type[$name]); } elseif ($notFound) { $method = Loader::parseName($name, 1, false); - if (method_exists($this, $method) && $this->$method() instanceof Relation) { + if (method_exists($this, $method) && $this->$method()->removeOption() instanceof Relation) { // 不存在该字段 获取关联数据 $value = $this->$method()->getRelation(); // 保存关联对象值