diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index af87e39fd..141aa516d 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -802,12 +802,18 @@ sub stats : Path('stats') : Args(0) { $field => { '>=', $start_date->ymd }, $field => { '<=', $end_date->ymd }, ], + }, + { + select => [ 'state', { 'count' => 'me.id' } ], + as => [qw/state count/], + group_by => [ 'state' ], + order_by => [ 'state' ], } ); # in case the total_report count is 0 $c->stash->{show_count} = 1; - $c->stash->{total_reports} = $p->count; + $c->stash->{states} = $p; } return 1; |