From 999e4fe15dbc31d2d2874381cc8b7c24fbded410 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Mon, 18 Mar 2024 13:41:42 +0100 Subject: [PATCH] exclude 0 scores from leaderboard calculation --- app/Models/Channel.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Models/Channel.php b/app/Models/Channel.php index bf3b98b..500f2e3 100644 --- a/app/Models/Channel.php +++ b/app/Models/Channel.php @@ -34,6 +34,7 @@ class Channel extends Model { public function getGuessingLeaderboard() { $query = $this->winners() ->selectRaw('(select t2.uname from guessing_winners t2 where t2.uid = guessing_winners.uid order by created_at desc limit 1) as name, sum(score) as score') + ->where('score', '!=', 0) ->groupBy('uid') ->orderBy('score', 'desc') ->limit(10); -- 2.39.2