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;