aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-10-23 14:58:30 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-10-23 14:58:30 +0100
commitda52879e407ffa683567e349c744f30171065a76 (patch)
tree4d02bc41b672de596903d8224894bb10745c7f12 /perllib/FixMyStreet/DB/ResultSet/Problem.pm
parent239148e9ba1e55ce205f4ec134c0baab104b0208 (diff)
parentaf7a602d2c83bdf0371ae253f5ba3f80cece077d (diff)
Merge branch '1251-json-status-page'
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 40076d374..e9f5d0f8e 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -210,7 +210,10 @@ sub unique_users {
return $rs->search( {
state => [ FixMyStreet::DB::Result::Problem->visible_states() ],
}, {
- select => [ { count => { distinct => 'user_id' } } ],
+ select => [ { distinct => 'user_id' } ],
+ as => [ 'user_id' ]
+ } )->as_subselect_rs->search( undef, {
+ select => [ { count => 'user_id' } ],
as => [ 'count' ]
} )->first->get_column('count');
}