From c3f974a3c0c66f049c7dac8a95f84c48850a48b0 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Wed, 21 Feb 2018 14:11:48 +0000 Subject: [PATCH] Make code compatible with 5.3 :( [MAILPOET-1279] --- lib/Models/Segment.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Models/Segment.php b/lib/Models/Segment.php index 0d8ec7f608..a6925d27f2 100644 --- a/lib/Models/Segment.php +++ b/lib/Models/Segment.php @@ -250,9 +250,13 @@ class Segment extends Model { static function getAnalytics() { $analytics = Segment::select_expr('type, count(*) as count') - ->whereNull('deleted_at') - ->groupBy('type') - ->findArray(); - return array_combine(array_column($analytics, 'type'), array_column($analytics, 'count')); + ->whereNull('deleted_at') + ->groupBy('type') + ->findArray(); + $result = array(); + foreach($analytics as $segment) { + $result[$segment['type']] = $segment['count']; + } + return $result; } }