Make code compatible with 5.3 :(
[MAILPOET-1279]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user