X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FStats.pm;h=a937e35bf6bf636839481d96954ba86adc908f6e;hb=9519c80241167db071e44cbdd1e1843daad6e305;hp=e2c784d929bb837f33c5504e12dbd2db87d0d236;hpb=677178daefe481e0144a2fc08ee2744839b450ad;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Stats.pm b/lib/NDWeb/Controller/Stats.pm index e2c784d..a937e35 100644 --- a/lib/NDWeb/Controller/Stats.pm +++ b/lib/NDWeb/Controller/Stats.pm @@ -62,7 +62,7 @@ FROM galaxies g GROUP BY raid,p.tick,x,y ) AS a JOIN galaxies g USING (tick,x,y) - WHERE a.count::float / g.planets >= 0.5 + WHERE a.count::float / NULLIF(g.planets,0) >= 0.5 ORDER BY x,y,tick ) AS raid USING (x,y) @@ -198,14 +198,6 @@ sub planet : Local { $query->execute($id); my @incomings; while (my $mission = $query->fetchrow_hashref){ - my @ships; - $ships->execute($mission->{id}); - if ($ships->rows != 0){ - while (my $ship = $ships->fetchrow_hashref){ - push @ships,$ship; - } - $mission->{ships} = \@ships; - } push @incomings,$mission; } $c->stash(incomings => \@incomings);