]> git.sesse.net Git - wloh/commitdiff
Limit subdivision display to the right locale.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 30 May 2012 19:49:45 +0000 (21:49 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 30 May 2012 19:49:45 +0000 (21:49 +0200)
www/rating.pl

index 5eb822807d1859b7b013c6f17960f83de2c2aacc..2118f40e4e3d9108709dca813987fdb09927ec00 100755 (executable)
@@ -85,8 +85,8 @@ my $season = wloh_common::get_max_season($dbh, $locale);
 
 # Pick up all the subdivisions' ratings.
 my %subdivision_ratings = ();
-my $q = $dbh->prepare('SELECT divisjon, avdeling, serie_id, AVG(rating) AS avg_rating FROM ratings NATURAL JOIN siste_divisjon WHERE sesong=? GROUP BY divisjon, avdeling, serie_id ORDER BY divisjon, avdeling');
-$q->execute($season);
+my $q = $dbh->prepare('SELECT divisjon, avdeling, serie_id, AVG(rating) AS avg_rating FROM ratings NATURAL JOIN siste_divisjon NATURAL JOIN spiller_kultur WHERE kultur=? AND sesong=? GROUP BY divisjon, avdeling, serie_id ORDER BY divisjon, avdeling');
+$q->execute($locale, $season);
 
 while (my $ref = $q->fetchrow_hashref) {
        my $division = $ref->{'divisjon'};