File tree 1 file changed +5
-2
lines changed
src/Illuminate/Database/Query
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2258,6 +2258,10 @@ protected function runPaginationCountQuery($columns = ['*'])
2258
2258
if ($ this ->groups || $ this ->havings ) {
2259
2259
$ clone = $ this ->cloneForPaginationCount ();
2260
2260
2261
+ if (is_null ($ clone ->columns ) && ! empty ($ this ->joins )) {
2262
+ $ clone ->select ($ this ->from .'.* ' );
2263
+ }
2264
+
2261
2265
return $ this ->newQuery ()
2262
2266
->from (new Expression ('( ' .$ clone ->toSql ().') as ' .$ this ->grammar ->wrap ('aggregate_table ' )))
2263
2267
->mergeBindings ($ clone )
@@ -2280,8 +2284,7 @@ protected function runPaginationCountQuery($columns = ['*'])
2280
2284
*/
2281
2285
protected function cloneForPaginationCount ()
2282
2286
{
2283
- return $ this ->select ($ this ->from .'.* ' )
2284
- ->cloneWithout (['orders ' , 'limit ' , 'offset ' ])
2287
+ return $ this ->cloneWithout (['orders ' , 'limit ' , 'offset ' ])
2285
2288
->cloneWithoutBindings (['order ' ]);
2286
2289
}
2287
2290
You can’t perform that action at this time.
0 commit comments