X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=NDWeb%2FPages%2FDefLeeches.pm;h=d187bb62cfce7eeae5eed2643933ce1997507941;hb=57f880656c4486f68583058121a5bcb3b316199c;hp=ec3010b9a9ea2ca8018f9e0e36a890988bb5c760;hpb=8a2cd692f0b8c1d5cef6c698642948607b4b8123;p=ndwebbie.git diff --git a/NDWeb/Pages/DefLeeches.pm b/NDWeb/Pages/DefLeeches.pm index ec3010b..d187bb6 100644 --- a/NDWeb/Pages/DefLeeches.pm +++ b/NDWeb/Pages/DefLeeches.pm @@ -39,7 +39,8 @@ sub render_body { my $query = $DBH->prepare(q{SELECT username,defense_points,count(id) AS calls, SUM(fleets) AS fleets, SUM(recalled) AS recalled FROM (SELECT username,defense_points,c.id,count(f.target) AS fleets, count(NULLIF(f.tick + f.eta -1 = f.back,TRUE)) AS recalled FROM users u JOIN calls c ON c.member = u.uid LEFT OUTER JOIN fleets f ON u.planet = f.target AND c.landing_tick = f.tick - WHERE (f.mission = 'Defend' AND f.uid > 0) OR f.target IS NULL + WHERE (f.mission = 'Defend' AND f.uid > 0 AND f.back IS NOT NULL AND NOT ingal) + OR f.target IS NULL GROUP BY username,defense_points,c.id ) d GROUP BY username,defense_points ORDER BY fleets DESC, defense_points @@ -47,9 +48,7 @@ sub render_body { $query->execute; my @members; - my $i = 0; while ( my $member = $query->fetchrow_hashref){ - $member->{ODD} = $i++ % 2; push @members,$member; } $BODY->param(Members => \@members);