]> ruin.nu Git - ndwebbie.git/blobdiff - lib/NDWeb/Controller/Raids.pm
Fixed typo
[ndwebbie.git] / lib / NDWeb / Controller / Raids.pm
index 217ce37c2265e8575647716ea7df76e1211c3692..2808d3297dfc304ce6ab7cc83a0f024b1cec5796 100644 (file)
@@ -137,23 +137,22 @@ sub view : Local {
                        #next if ($target->{score}/$planet->{score} < 0.4) && ($target->{value}/$planet->{value} < 0.4);
                }
 
-               my $unitscans = $dbh->prepare(q{ 
-                       SELECT DISTINCT ON (name) i.id,i.name, i.tick, i.amount 
-                       FROM fleets i
-                       WHERE  i.uid = -1
-                               AND i.sender = ?
-                               AND i.mission = 'Full fleet'
-                       GROUP BY i.id,i.tick,i.name,i.amount
-                       ORDER BY name,i.tick DESC
+               my $unitscans = $dbh->prepare(q{
+SELECT DISTINCT ON (name) fid, name, tick, amount
+FROM fleets
+WHERE planet = ?
+       AND mission = 'Full fleet'
+GROUP BY fid,tick,name,amount
+ORDER BY name,tick DESC
                });
                $unitscans->execute($target->{planet});
                my $ships = $dbh->prepare(q{SELECT ship,amount FROM fleet_ships
-                       WHERE id = ? ORDER BY num
+                       WHERE fid = ? ORDER BY num
                });
                my @missions;
                while (my $mission = $unitscans->fetchrow_hashref){
                        my @ships;
-                       $ships->execute($mission->{id});
+                       $ships->execute($mission->{fid});
                        while (my $ship = $ships->fetchrow_hashref){
                                push @ships,$ship;
                        }
@@ -234,7 +233,7 @@ sub edit : Local {
        }elsif ($order && $order eq 'race'){
                $order .= ' ASC';
        }else {
-               $order .= 'p.x,p.y,p.z';
+               $order = 'p.x,p.y,p.z';
        }
 
        my $targetquery = $dbh->prepare(qq{SELECT r.id,coords(x,y,z),comment,size