Skip to content

Commit

Permalink
[5.4] clone query without order by for aggregates (#19064)
Browse files Browse the repository at this point in the history
* clone query without order by for aggregates

* Update Builder.php
  • Loading branch information
vetruvet authored and taylorotwell committed May 5, 2017
1 parent 06761dd commit 2059cae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,12 @@ protected function setAggregate($function, $columns)
{
$this->aggregate = compact('function', 'columns');

if (empty($this->groups)) {
$this->orders = null;

$this->bindings['order'] = [];
}

return $this;
}

Expand Down

0 comments on commit 2059cae

Please sign in to comment.