From e1dcc7600950592294588f5980bef59a018dd768 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 23 Jan 2008 20:25:43 +0100 Subject: [PATCH] Explicit ordering of fleets, so they're shown as normal unit scans --- NDWeb/Pages/Calls.pm | 2 +- NDWeb/Pages/Check.pm | 4 +++- NDWeb/Pages/Main.pm | 5 +++-- NDWeb/Pages/Raids.pm | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/NDWeb/Pages/Calls.pm b/NDWeb/Pages/Calls.pm index e8cdd2a..6e51754 100644 --- a/NDWeb/Pages/Calls.pm +++ b/NDWeb/Pages/Calls.pm @@ -159,7 +159,7 @@ sub render_body { AND (i.tick > $2 - 14 OR i.mission = 'Full fleet') ORDER BY i.tick,x,y,z }); - my $ships = $DBH->prepare('SELECT ship,amount FROM fleet_ships WHERE id = ?'); + my $ships = $DBH->prepare('SELECT ship,amount FROM fleet_ships WHERE id = ? ORDER BY num'); $outgoings->execute($call->{planet},$call->{landing_tick}); my @fleets; while (my $fleet = $outgoings->fetchrow_hashref){ diff --git a/NDWeb/Pages/Check.pm b/NDWeb/Pages/Check.pm index cac7f92..88e37e6 100644 --- a/NDWeb/Pages/Check.pm +++ b/NDWeb/Pages/Check.pm @@ -147,7 +147,9 @@ sub render_body { ORDER BY i.tick,x,y,z }); $query->execute($planet_id); - my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships WHERE id = ?}); + my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships + WHERE id = ? ORDER BY num + }); my @missions; while (my $mission = $query->fetchrow_hashref){ $mission->{CLASS} = $mission->{mission}; diff --git a/NDWeb/Pages/Main.pm b/NDWeb/Pages/Main.pm index b4c793b..8a3233c 100644 --- a/NDWeb/Pages/Main.pm +++ b/NDWeb/Pages/Main.pm @@ -208,7 +208,6 @@ sub render_body { $query = $DBH->prepare(q{SELECT f.id, coords(x,y,z) AS target, mission , f.amount, tick, back FROM fleets f -JOIN fleet_ships fs USING (id) LEFT OUTER JOIN current_planet_stats p ON f.target = p.id WHERE f.uid = ? AND f.sender = ? AND (back >= ? OR (tick >= tick() - 24 AND name = 'Main')) @@ -216,7 +215,9 @@ GROUP BY f.id, x,y,z, mission, tick,back,f.amount ORDER BY x,y,z,mission,tick }); - my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships where id = ?}); + my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships + WHERe id = ? ORDER BY num + }); $query->execute($self->{UID},$self->{PLANET},$self->{TICK}) or warn $DBH->errstr; my @fleets; diff --git a/NDWeb/Pages/Raids.pm b/NDWeb/Pages/Raids.pm index 0b342fa..4b45458 100644 --- a/NDWeb/Pages/Raids.pm +++ b/NDWeb/Pages/Raids.pm @@ -245,7 +245,9 @@ sub render_body { ORDER BY name,i.tick DESC }); $unitscans->execute($target->{planet}) or warn $DBH->errstr; - my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships WHERE id = ?}); + my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships + WHERE id = ? ORDER BY num + }); my @missions; while (my $mission = $unitscans->fetchrow_hashref){ my @ships; -- 2.39.2