From 550de110fedf52349a82b30c2735815925ed6468 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 7 Feb 2017 22:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BBrelationQuery?= =?UTF-8?q?=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, 3 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 4a73bf39..d4db7813 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1492,6 +1492,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 支持闭包查询过滤关联条件 $closure = $relation; $relation = $key; + } elseif (is_array($relation)) { + $subRelation = $relation; + $relation = $key; } if (strpos($relation, '.')) { list($relation, $subRelation) = explode('.', $relation, 2);