Skip to content

Commit 98a242e

Browse files
committed
formatting
1 parent 858f454 commit 98a242e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/Illuminate/Database/Query/Builder.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,10 @@ protected function runPaginationCountQuery($columns = ['*'])
22582258
if ($this->groups || $this->havings) {
22592259
$clone = $this->cloneForPaginationCount();
22602260

2261+
if (is_null($clone->columns) && ! empty($this->joins)) {
2262+
$clone->select($this->from.'.*');
2263+
}
2264+
22612265
return $this->newQuery()
22622266
->from(new Expression('('.$clone->toSql().') as '.$this->grammar->wrap('aggregate_table')))
22632267
->mergeBindings($clone)
@@ -2280,8 +2284,7 @@ protected function runPaginationCountQuery($columns = ['*'])
22802284
*/
22812285
protected function cloneForPaginationCount()
22822286
{
2283-
return $this->select($this->from.'.*')
2284-
->cloneWithout(['orders', 'limit', 'offset'])
2287+
return $this->cloneWithout(['orders', 'limit', 'offset'])
22852288
->cloneWithoutBindings(['order']);
22862289
}
22872290

0 commit comments

Comments
 (0)