From: Steinar H. Gunderson Date: Mon, 23 Apr 2012 22:43:46 +0000 (+0200) Subject: When making division ranking, only include the players that are active in the current... X-Git-Url: https://git.sesse.net/?p=wloh;a=commitdiff_plain;h=66520572d4efff80922e24d0169a76d5e640c952 When making division ranking, only include the players that are active in the current season. --- diff --git a/www/rating.pl b/www/rating.pl index 604ca28..0c42ccc 100755 --- a/www/rating.pl +++ b/www/rating.pl @@ -84,8 +84,10 @@ printf <<"EOF", $params{-3}, $match_stddev; EOF -$q = $dbh->prepare('SELECT divisjon,AVG(rating) AS avg_rating,STDDEV(rating) AS stddev_rating FROM ratings NATURAL JOIN siste_divisjon GROUP BY divisjon ORDER BY divisjon'); -$q->execute; +my $season = wloh_common::get_max_season($dbh); + +$q = $dbh->prepare('SELECT divisjon,AVG(rating) AS avg_rating,STDDEV(rating) AS stddev_rating FROM ratings NATURAL JOIN siste_divisjon WHERE sesong=? GROUP BY divisjon ORDER BY divisjon'); +$q->execute($season); my $i = 0; while (my $ref = $q->fetchrow_hashref) {