From d313bc75596639e49a02552bb0f3a38f1c397c32 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Tue, 25 Mar 2014 09:54:14 +0100 Subject: [PATCH] MT#4369 callflow: count total correctly this group_by is ok, because it is optimized by mysql and the index on call_id is still used --- lib/NGCP/Panel/Controller/Callflow.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Controller/Callflow.pm b/lib/NGCP/Panel/Controller/Callflow.pm index d483f8db49..32a550be16 100644 --- a/lib/NGCP/Panel/Controller/Callflow.pm +++ b/lib/NGCP/Panel/Controller/Callflow.pm @@ -44,7 +44,7 @@ sub ajax :Chained('root') :PathPart('ajax') :Args(0) { my $calls_rs_cb = sub { my %params = @_; - my $total_count = $c->model('DB')->resultset('messages')->search(undef,{select => \'distinct(call_id)'})->count; + my $total_count = $c->model('DB')->resultset('messages')->search(undef,{group_by => 'call_id'})->count; my $base_rs = $c->model('DB')->resultset('messages_custom'); my $searchstring = $params{searchstring} ? $params{searchstring}.'%' : '';