From 13a5a3d9b6704fadfc244b35de63909d63bea2c9 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 14 May 2017 13:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=A8=A1=E5=9E=8B=E7=9A=84ap?= =?UTF-8?q?pendRelationAttr=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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 79216ef5..fb3ece2c 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -661,10 +661,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $relation = Loader::parseName($relation, 1, false); + // 获取关联数据 if (isset($this->relation[$relation])) { $model = $this->relation[$relation]; } else { - $model = $this->getAttr($relation); + $model = $this->getRelationData($this->$relation()); } if ($model instanceof Model) {