File tree Expand file tree Collapse file tree
src/Illuminate/Database/Query Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments