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
164164 $ builder = clone $ this ->query ;
165165
166166 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 )) {
171169 return $ this ->getConnection ()
172170 ->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 ());
175173 }
176174
175+ $ builder = clone $ this ->query ;
176+
177177 return $ this ->getConnection ()
178178 ->query ()
179179 ->fromRaw ('( ' .$ builder ->toSql ().') count_row_table ' )
@@ -813,7 +813,7 @@ public function getFilteredQuery(): QueryBuilder
813813 *
814814 * @return $this
815815 */
816- public function ignoreSelectsInCountQuery ()
816+ public function ignoreSelectsInCountQuery (): static
817817 {
818818 $ this ->ignoreSelectInCountQuery = true ;
819819
You can’t perform that action at this time.
0 commit comments