File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ protected function checkIfQueryIsForSearchingPurpose()
255255 {
256256 if ( $ this ->request ->isSearchable () )
257257 {
258- $ this ->totalData = $ this ->query ->count ();
258+ $ this ->totalData = $ this ->query ->getCountForPagination ();
259259 $ this ->searchQuery ();
260260 }
261261 }
@@ -269,30 +269,22 @@ protected function setTotalDataAndFiltered()
269269 {
270270 if ( ! $ this ->totalData )
271271 {
272- // to get correct result count in case of group by
273- if ( $ this ->query ->groups )
274- {
275- $ this ->totalData = $ this ->query ->getCountForPagination ();
276- }
277- else
278- {
279- $ this ->totalData = $ this ->query ->count ();
280- }
272+ $ this ->totalData = $ this ->query ->getCountForPagination ();
281273
282274 $ this ->totalFiltered = $ this ->totalData ;
283275 }
284276 else
285277 {
286278
287- $ this ->totalFiltered = $ this ->query ->count ();
279+ $ this ->totalFiltered = $ this ->query ->getCountForPagination ();
288280 if ( !$ this ->totalFiltered )
289281 {
290282 if (!empty ($ this ->havingColumns ))
291283 {
292284 $ this ->query ->bindings ['where ' ] = [];
293285 $ this ->query ->wheres = [];
294286 $ this ->havingCondition ($ this ->request ->getSearchString (), $ this ->havingColumns );
295- $ this ->totalFiltered = $ this ->query ->count ();
287+ $ this ->totalFiltered = $ this ->query ->getCountForPagination ();
296288 }
297289 }
298290 }
You can’t perform that action at this time.
0 commit comments