File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,12 @@ public function prepareCountQuery(): QueryBuilder
176176 $ builder ->select (DB ::raw ('1 as dt_row_count ' ));
177177 $ clone = $ builder ->clone ();
178178 $ clone ->setBindings ([]);
179- $ clone ->wheres = [];
179+ if ($ clone instanceof EloquentBuilder) {
180+ $ clone ->getQuery ()->wheres = [];
181+ } else {
182+ $ clone ->wheres = [];
183+ }
184+
180185 if ($ this ->isComplexQuery ($ clone )) {
181186 if (!$ this ->ignoreSelectInCountQuery ) {
182187 $ builder = clone $ this ->query ;
@@ -188,8 +193,8 @@ public function prepareCountQuery(): QueryBuilder
188193 ->setBindings ($ builder ->getBindings ());
189194 }
190195 }
191- $ row_count = $ this ->wrap ('row_count ' );
192- $ builder ->select ($ this ->getConnection ()->raw ("'1' as {$ row_count }" ));
196+ $ row_count = $ this ->wrap ('row_count ' );
197+ $ builder ->select ($ this ->getConnection ()->raw ("'1' as {$ row_count }" ));
193198
194199 if (!$ this ->keepSelectBindings ) {
195200 $ builder ->setBindings ([], 'select ' );
You can’t perform that action at this time.
0 commit comments