X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FAlliances.pm;h=5f3372655474d454f355131c6ebd0c58d0390372;hp=348884acaa1893c1b18335c37d42f8d10c79f79b;hb=07aec9f5f20e4a605d65bbe2337a05663c0b16e7;hpb=208f038007b693c71734ee3c4bbee3ef7dc43cef diff --git a/lib/NDWeb/Controller/Alliances.pm b/lib/NDWeb/Controller/Alliances.pm index 348884a..5f33726 100644 --- a/lib/NDWeb/Controller/Alliances.pm +++ b/lib/NDWeb/Controller/Alliances.pm @@ -4,8 +4,6 @@ use strict; use warnings; use parent 'Catalyst::Controller'; -use NDWeb::Include; - =head1 NAME NDWeb::Controller::Alliances - Catalyst Controller @@ -95,13 +93,15 @@ sub edit : Local { my $ticks = $c->req->param('ticks') || 48; $c->stash(showticks => $ticks); - $query = $dbh->prepare(intelquery q{ - o.alliance AS oalliance ,coords(o.x,o.y,o.z) AS ocoords, i.sender - ,t.alliance AS talliance,coords(t.x,t.y,t.z) AS tcoords, i.target - },q{NOT ingal AND (o.alliance = $1 OR t.alliance = $1) - AND (i.mission = 'Defend' OR i.mission = 'AllyDef') - AND COALESCE( t.alliance != o.alliance, TRUE) - AND i.tick > (tick() - $2) + $query = $dbh->prepare(q{ +SELECT salliance, scoords, sender, talliance, tcoords, target + ,mission, tick AS landingtick, eta, amount, ingal, username +FROM full_intel +WHERE NOT ingal AND (salliance = $1 OR talliance = $1) + AND (mission = 'Defend' OR mission = 'AllyDef') + AND COALESCE( talliance <> salliance, TRUE) + AND tick > (tick() - $2) +ORDER BY tick DESC, mission }); $query->execute($a->{name}, $ticks); $c->stash(intel => $query->fetchall_arrayref({}) );