]> git.localhorst.tv Git - alttp.git/commitdiff
exclude 0 scores from leaderboard calculation
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 18 Mar 2024 12:41:42 +0000 (13:41 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 18 Mar 2024 12:41:42 +0000 (13:41 +0100)
app/Models/Channel.php

index bf3b98bc2b231c384a3079613e551514a7435c02..500f2e33e6f9fb3456694d7dc403159dd7205260 100644 (file)
@@ -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);