Make code compatible with 5.3 :(
[MAILPOET-1279]
This commit is contained in:
@@ -250,9 +250,13 @@ class Segment extends Model {
|
|||||||
|
|
||||||
static function getAnalytics() {
|
static function getAnalytics() {
|
||||||
$analytics = Segment::select_expr('type, count(*) as count')
|
$analytics = Segment::select_expr('type, count(*) as count')
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->groupBy('type')
|
->groupBy('type')
|
||||||
->findArray();
|
->findArray();
|
||||||
return array_combine(array_column($analytics, 'type'), array_column($analytics, 'count'));
|
$result = array();
|
||||||
|
foreach($analytics as $segment) {
|
||||||
|
$result[$segment['type']] = $segment['count'];
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user