From 2db77f1aad3ff7d3966579ab2d1f52050a993d2c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 16 Jan 2017 15:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=85=B3=E8=81=94=E5=B5=8C?= =?UTF-8?q?=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index d4003a2d..a6f11353 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1290,7 +1290,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $relation = $key; } if (strpos($relation, '.')) { - list($relation, $subRelation) = explode('.', $relation); + list($relation, $subRelation) = explode('.', $relation, 2); } $method = Loader::parseName($relation, 1, false); $this->data[$relation] = $this->$method()->getRelation($subRelation, $closure); @@ -1317,7 +1317,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $relation = $key; } if (strpos($relation, '.')) { - list($relation, $subRelation) = explode('.', $relation); + list($relation, $subRelation) = explode('.', $relation, 2); } $relation = Loader::parseName($relation, 1, false); $this->$relation()->eagerlyResultSet($resultSet, $relation, $subRelation, $closure, $class); @@ -1344,7 +1344,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $relation = $key; } if (strpos($relation, '.')) { - list($relation, $subRelation) = explode('.', $relation); + list($relation, $subRelation) = explode('.', $relation, 2); } $relation = Loader::parseName($relation, 1, false); $this->$relation()->eagerlyResult($result, $relation, $subRelation, $closure, $class);