From 56bce822f3d6c28cb333eb9d204e5451e44b922c Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 7 Sep 2017 11:40:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/model/relation/HasMany.php | 1 + 1 file changed, 1 insertion(+) diff --git a/library/think/model/relation/HasMany.php b/library/think/model/relation/HasMany.php index 4bf4e945..6dbf9dd3 100644 --- a/library/think/model/relation/HasMany.php +++ b/library/think/model/relation/HasMany.php @@ -244,6 +244,7 @@ class HasMany extends Relation return $this->parent->db() ->alias($model) + ->field($model . '.*') ->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $joinType) ->group($relation . '.' . $this->foreignKey) ->having('count(' . $id . ')' . $operator . $count);