Commit 7f6f3f6f by Qiang Xue

Merge pull request #2850 from Koudy/db-query-queryScalar

Fixed getting the count for queries with the union
parents b393ea0d 411dc71b
......@@ -359,7 +359,7 @@ class Query extends Component implements QueryInterface
$this->limit = $limit;
$this->offset = $offset;
if (empty($this->groupBy) && !$this->distinct) {
if (empty($this->groupBy) && empty($this->union) && !$this->distinct) {
return $command->queryScalar();
} else {
return (new Query)->select([$selectExpression])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment