From e82013e4e20f26d0cd09a04ff3a58143cf328eb0 Mon Sep 17 00:00:00 2001 From: Jade Geels Date: Fri, 21 Jul 2023 08:13:37 +0200 Subject: [PATCH] Fix overcounting stars because of inclusive range (#4) --- src/Tags/Reviews.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tags/Reviews.php b/src/Tags/Reviews.php index e6f72fa..78a710d 100644 --- a/src/Tags/Reviews.php +++ b/src/Tags/Reviews.php @@ -42,7 +42,7 @@ public function getRatingData(): array for ($star = 1; $star <= 5; $star++) { $maxScore = $star * 2; - $minScore = $maxScore - 2; + $minScore = $maxScore - 1; $reviewsCount = EntryFacade::query() ->where('collection', 'reviews') ->whereBetween('total_score', [$minScore, $maxScore])