]> git.sesse.net Git - foosball/commitdiff
Fix the ordering of almost-equal games on the front page.
authorSteinar H. Gunderson <sesse@debian.org>
Tue, 16 Oct 2007 15:22:08 +0000 (17:22 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Tue, 16 Oct 2007 15:22:08 +0000 (17:22 +0200)
www/index.pl

index c31200a59586c5260fbadb8533cebdca7b95af64..80c874b36f41e584cf946c2b74d8f4bc29b7ce21 100755 (executable)
@@ -65,6 +65,7 @@ my @last_games = ();
 $q = $dbh->prepare('
 select * from (
     select
+        gametime as sort_gametime,
         to_char(gametime, \'IYYY-MM-DD HH24:MI\') as gametime,
         \'Double\' as type,
        team1_username1 || \' / \' || team1_username2 as username1,
@@ -91,6 +92,7 @@ select * from (
            and re.team2_username2=ra4.username
     union all
     select
+        gametime as sort_gametime,
         to_char(gametime, \'IYYY-MM-DD HH24:MI\') as gametime,
        \'Single\' as type,
        username1,
@@ -110,7 +112,7 @@ select * from (
            on re.gametime=ra2.ratetime
            and re.username2=ra2.username
 ) t1
-order by gametime desc limit 10');
+order by sort_gametime desc limit 10');
 $q->execute();
 while (my $ref = $q->fetchrow_hashref) {
        if (defined($ref->{'diff2'})) {