From 85c06ae827b83df16d03dba8aa2e540d66904180 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 4 Dec 2018 18:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bcount=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 53d8aea8..42b1c120 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -546,9 +546,9 @@ class Query $options = $this->getOptions(); $subSql = $this->options($options)->field('count(' . $field . ')')->bind($this->bind)->buildSql(); - $count = $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0); + $count = $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0, true); } else { - $count = $this->aggregate('COUNT', $field); + $count = $this->aggregate('COUNT', $field, true); } return is_string($count) ? $count : (int) $count;