From e825050814384305f7f8f2deac9ef23eedb56ce9 Mon Sep 17 00:00:00 2001 From: Craig Williams Date: Tue, 22 Feb 2022 13:18:23 +0000 Subject: [PATCH] Fixed incorrect counts due to the left-join --- src/Sprunje/UserSprunje.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Sprunje/UserSprunje.php b/src/Sprunje/UserSprunje.php index e697ad5..17573cf 100644 --- a/src/Sprunje/UserSprunje.php +++ b/src/Sprunje/UserSprunje.php @@ -82,4 +82,28 @@ class UserSprunje extends UFUserSprunje return $this; } + + /** + * Get the unpaginated count of items (before filtering) in this query. + * + * @param Builder $query + * + * @return int + */ + protected function count($query) + { + return $query->distinct('users.id')->count(); + } + + /** + * Get the unpaginated count of items (after filtering) in this query. + * + * @param Builder $query + * + * @return int + */ + protected function countFiltered($query) + { + return $query->distinct('users.id')->count(); + } }