File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,16 @@ public function prepareCountQuery(): QueryBuilder
164
164
$ builder = clone $ this ->query ;
165
165
166
166
if ($ this ->isComplexQuery ($ builder )) {
167
- $ query_without_selects = clone $ this ->query ;
168
- $ query_without_selects ->select (DB ::raw ('1 ' ));
169
-
170
- if ($ this ->ignoreSelectInCountQuery || ! $ this ->isComplexQuery ($ query_without_selects )) {
167
+ $ builder ->select (DB ::raw ('1 ' ));
168
+ if ($ this ->ignoreSelectInCountQuery || ! $ this ->isComplexQuery ($ builder )) {
171
169
return $ this ->getConnection ()
172
170
->query ()
173
- ->fromRaw ('( ' .$ query_without_selects ->toSql ().') count_row_table ' )
174
- ->setBindings ($ query_without_selects ->getBindings ());
171
+ ->fromRaw ('( ' .$ builder ->toSql ().') count_row_table ' )
172
+ ->setBindings ($ builder ->getBindings ());
175
173
}
176
174
175
+ $ builder = clone $ this ->query ;
176
+
177
177
return $ this ->getConnection ()
178
178
->query ()
179
179
->fromRaw ('( ' .$ builder ->toSql ().') count_row_table ' )
@@ -813,7 +813,7 @@ public function getFilteredQuery(): QueryBuilder
813
813
*
814
814
* @return $this
815
815
*/
816
- public function ignoreSelectsInCountQuery ()
816
+ public function ignoreSelectsInCountQuery (): static
817
817
{
818
818
$ this ->ignoreSelectInCountQuery = true ;
819
819
You can’t perform that action at this time.
0 commit comments