diff options
author | Marius Halden <marius.h@lden.org> | 2017-12-20 01:06:27 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-12-20 01:06:27 +0100 |
commit | 8b10c8b8d787e680bb085e2a7543dac50fd39742 (patch) | |
tree | 391efde6de4944e350cc0dafbd4e1efb0613e9c3 /perllib/FixMyStreet/DB/ResultSet/Problem.pm | |
parent | eef35397ccf8242cdc65dc666db2958b1ee35440 (diff) | |
parent | 7e15bd3db202363db4bab8fa7c9f462eabe28fce (diff) |
Merge tag 'v2.3' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index f1ed50721..ae45351c4 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -140,11 +140,11 @@ sub _recent { # Problems around a location sub around_map { - my ( $rs, $limit, %p) = @_; + my ( $rs, $c, %p) = @_; my $attr = { order_by => $p{order}, }; - $attr->{rows} = $limit if $limit; + $attr->{rows} = $c->cobrand->reports_per_page; unless ( $p{states} ) { $p{states} = FixMyStreet::DB::Result::Problem->visible_states(); @@ -156,12 +156,12 @@ sub around_map { latitude => { '>=', $p{min_lat}, '<', $p{max_lat} }, longitude => { '>=', $p{min_lon}, '<', $p{max_lon} }, }; - $q->{'current_timestamp - lastupdate'} = { '<', \"'$p{interval}'::interval" } - if $p{interval}; $q->{category} = $p{categories} if $p{categories} && @{$p{categories}}; - my @problems = mySociety::Locale::in_gb_locale { $rs->search( $q, $attr )->include_comment_counts->all }; - return \@problems; + my $problems = mySociety::Locale::in_gb_locale { + $rs->search( $q, $attr )->include_comment_counts->page($p{page}); + }; + return $problems; } # Admin functions |