From: Daniel Karbach Date: Mon, 18 Mar 2024 12:41:42 +0000 (+0100) Subject: exclude 0 scores from leaderboard calculation X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=999e4fe15dbc31d2d2874381cc8b7c24fbded410;p=alttp.git exclude 0 scores from leaderboard calculation --- 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);