From a3a37e6cfad132d5b02ffff8f23a4abc565f7928 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 7 Feb 2017 17:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Model=E7=B1=BBhasWhere?= =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 29ed3afa..4a73bf39 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1450,7 +1450,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $model = new static(); $relation = $model->$relation(); if ($relation instanceof HasMany) { - return $model->$relation()->hasWhere($where); + return $relation->hasWhere($where); } else { return $relation; }