diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Nearby.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Nearby.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm index b075e3664..3d8f87b9f 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Nearby.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Nearby.pm @@ -10,7 +10,7 @@ sub to_body { } sub nearby { - my ( $rs, $c, $dist, $ids, $limit, $mid_lat, $mid_lon, $categories, $states, $extra_params ) = @_; + my ( $rs, $c, $dist, $ids, $limit, $mid_lat, $mid_lon, $categories, $states, $extra_params, $report_age ) = @_; unless ( $states ) { $states = FixMyStreet::DB::Result::Problem->visible_states(); @@ -23,6 +23,9 @@ sub nearby { if $ids; $params->{category} = $categories if $categories && @$categories; + $params->{$c->stash->{report_age_field}} = { '>=', \"current_timestamp-'$report_age'::interval" } + if $report_age; + FixMyStreet::DB::ResultSet::Problem->non_public_if_possible($params, $c); $rs = $c->cobrand->problems_restriction($rs); |