X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fndrank.pl;h=abfd1cec973f356569e148b2d9e35fa19ae31873;hb=36a13cae169413fc04fbf704d94a2ad797336e6e;hp=acb1405d3a282ede1bcd1adf73e1746b1dcbdebf;hpb=b52c7c95096825846f53e73de627e6cda01d9bca;p=ndwebbie.git diff --git a/scripts/ndrank.pl b/scripts/ndrank.pl index acb1405..abfd1ce 100755 --- a/scripts/ndrank.pl +++ b/scripts/ndrank.pl @@ -25,8 +25,6 @@ use warnings; use DBI; use DBD::Pg qw(:pg_types); -use LWP::Simple; - use FindBin; use lib "$FindBin::Bin/../lib"; @@ -35,7 +33,7 @@ use ND::DB; our $dbh = ND::DB::DB(); $dbh->begin_work; -my $st = $dbh->prepare(q{SELECT uid FROM current_planet_stats p JOIN users u ON p.id = u.planet WHERE alliance_id = 1 ORDER BY score DESC}); +my $st = $dbh->prepare(q{SELECT uid FROM current_planet_stats p JOIN users u USING (pid) WHERE alliance = 'NewDawn' ORDER BY score DESC}); my $update = $dbh->prepare(q{UPDATE users SET rank = ? WHERE uid = ?}); $st->execute; my $rank = 1;