diff options
author | Edmund von der Burg <evdb@ecclestoad.co.uk> | 2011-02-08 11:14:26 -0300 |
---|---|---|
committer | Edmund von der Burg <evdb@ecclestoad.co.uk> | 2011-02-08 11:14:26 -0300 |
commit | 7cf46ee96e224095a7f2adb925f2b4ff16eb63e7 (patch) | |
tree | 11825d002e2b4e3021a836b2c03ef699df1ec95b /perllib/Problems.pm | |
parent | 98e6f22852e469873fa05f9d8dca25b0d170edc7 (diff) |
convert various map functions
Diffstat (limited to 'perllib/Problems.pm')
-rw-r--r-- | perllib/Problems.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perllib/Problems.pm b/perllib/Problems.pm index 7a4c4974e..8a142a0a3 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -170,21 +170,21 @@ sub front_stats { # Problems around a location sub around_map { - my ($min_e, $max_e, $min_n, $max_n, $interval, $limit) = @_; + my ($min_lat, $max_lat, $min_lon, $max_lon, $interval, $limit) = @_; my $limit_clause = ''; if ($limit) { $limit_clause = " limit $limit"; } mySociety::Locale::in_gb_locale { select_all( - "select id,title,easting,northing,state, + "select id,title,latitude,longitude,state, extract(epoch from confirmed) as time from problem where state in ('confirmed', 'fixed') - and easting>=? and easting<? and northing>=? and northing<? " . + and latitude>=? and latitude<? and longitude>=? and longitude<? " . ($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') . " $site_restriction order by created desc - $limit_clause", $min_e, $max_e, $min_n, $max_n); + $limit_clause", $min_lat, $max_lat, $min_lon, $max_lon); }; } |