]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/Alliances.pm
better parsing
[ndwebbie.git] / ND / Web / Pages / Alliances.pm
index 117b0e4b9671adea435a69f07bbcd1a2ee239e7e..f9b830fc1c58a10c0a416a25a36a1e4dddb804dc 100644 (file)
@@ -24,7 +24,7 @@ use ND::Include;
 use CGI qw/:standard/;
 use ND::Web::Include;
 
-our @ISA = qw/ND::Web::XMLPage/;
+use base qw/ND::Web::XMLPage/;
 
 $ND::Web::Page::PAGES{alliances} = __PACKAGE__;
 
@@ -130,7 +130,7 @@ sub render_body {
                        $order = "$1 DESC";
                }
                my $query = $DBH->prepare(qq{
-                       SELECT DISTINCT a.id,name,COALESCE(s.score,SUM(p.score)) AS score,COALESCE(s.size,SUM(p.size)) AS size,s.members,count(*) AS kmem,
+                       SELECT DISTINCT a.id,name,COALESCE(s.score,SUM(p.score)) AS score,COALESCE(s.size,SUM(p.size)) AS size,s.members,count(p.score) AS kmem,
                        COALESCE(SUM(p.score),-1) AS kscore, COALESCE(SUM(p.size),-1) AS ksize, COALESCE(SUM(p.xp),-1) AS kxp,COALESCE(SUM(p.value),-1) AS kvalue,
                        COALESCE(s.score/LEAST(s.members,60),-1) AS scavg, COALESCE(AVG(p.score)::int,-1) AS kscavg, COALESCE(s.size/s.members,-1) AS siavg,
                        COALESCE(AVG(p.size)::int,-1) AS ksiavg, COALESCE(AVG(p.xp)::int,-1) AS kxpavg, COALESCE(AVG(p.value)::int,-1) AS kvalavg