From c31f0158518ce12f4d85a99a0527091e75e2b34d Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Wed, 10 Jan 2018 11:34:38 +0100 Subject: [PATCH] TT#29350 get_json() respect column_method dbix accessor * column_method accessor is aliased as method Change-Id: I74172a1c03d35d1e85094d5b932d8523d79013de --- lib/NGCP/Panel/Controller/Subscriber.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Subscriber.pm b/lib/NGCP/Panel/Controller/Subscriber.pm index 7fbd4ecce2..224b8a7e3b 100644 --- a/lib/NGCP/Panel/Controller/Subscriber.pm +++ b/lib/NGCP/Panel/Controller/Subscriber.pm @@ -4748,14 +4748,18 @@ sub get_json :Chained('callflow_base') :PathPart('json') :Args(0) { }); return unless($calls_rs); - my @cols = qw(method timestamp src_ip dst_ip call_id payload transport id src_port dst_port request_uri); + my $ac = { method => 'column_method' }; my @msgs; foreach my $row ($calls_rs->all ) { - my $m = { map { $_ => $row->$_.'' } @cols }; - push(@msgs, $m); + my $m = { map { + my $col = $_; + my $ac = $ac->{$col} // $col; + $col => $row->$ac.''; + } @cols }; + push(@msgs, $m); } $c->response->content_type('application/json');