feat: add map analytics, add episodes analytics, clean analytics page layout, translate countries

This commit is contained in:
Benjamin Bellamy 2020-10-14 10:38:48 +00:00 committed by Yassine Doghri
commit 07eae83a00
27 changed files with 705 additions and 192 deletions

View file

@ -36,7 +36,7 @@ class AnalyticsPodcastModel extends Model
$found = $this->select('`date` as `labels`, `hits` as `values`')
->where([
'`podcast_id`' => $podcastId,
'`date` >' => date('Y-m-d', strtotime('-1 year')),
'`date` >' => date('Y-m-d', strtotime('-60 days')),
])
->orderBy('`labels`', 'ASC')
->findAll();
@ -60,7 +60,6 @@ class AnalyticsPodcastModel extends Model
->selectSum('`hits`', '`values`')
->where([
'`podcast_id`' => $podcastId,
'`date` >' => date('Y-m-d', strtotime('-1 year')),
])
->groupBy('`labels`')
->orderBy('`labels`', 'ASC')
@ -94,7 +93,7 @@ class AnalyticsPodcastModel extends Model
)
->where([
'`podcast_id`' => $podcastId,
'`date` >' => date('Y-m-d', strtotime('-1 year')),
'`date` >' => date('Y-m-d', strtotime('-60 days')),
])
->orderBy('`labels`', 'ASC')
->findAll();