diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-01-22 17:47:52 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-01-22 17:47:52 +0000 |
commit | 71c4b7a598c6b0b441eef63b1e1e016bd45e9991 (patch) | |
tree | b6d3b99fb0a1df702ce908bee7447a4345483565 /perllib/Problems.pm | |
parent | 5cb1d987e8a7abd25c2a256ad167fcde47b0b2ed (diff) | |
parent | ab6c078efbbb3fd01da903d0f6b076186371a1f9 (diff) |
Merge branch 'master' into reportemptyhomes
Diffstat (limited to 'perllib/Problems.pm')
-rw-r--r-- | perllib/Problems.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/Problems.pm b/perllib/Problems.pm index 788074e37..1556b7724 100644 --- a/perllib/Problems.pm +++ b/perllib/Problems.pm @@ -176,7 +176,9 @@ sub around_map { $limit_clause = " limit $limit"; } mySociety::Locale::in_gb_locale { select_all( - "select id,title,easting,northing,state from problem + "select id,title,easting,northing,state, + extract(epoch from confirmed) as time + from problem where state in ('confirmed', 'fixed') and easting>=? and easting<? and northing>=? and northing<? " . ($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') . @@ -189,7 +191,8 @@ sub around_map { sub nearby { my ($dist, $ids, $limit, $mid_e, $mid_n, $interval) = @_; mySociety::Locale::in_gb_locale { select_all( - "select id, title, easting, northing, distance, state + "select id, title, easting, northing, distance, state, + extract(epoch from confirmed) as time from problem_find_nearby(?, ?, $dist) as nearby, problem where nearby.problem_id = problem.id " . ($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') . |