Loading app/Models/AnalyticsPodcastByCountryModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -35,13 +35,13 @@ class AnalyticsPodcastByCountryModel extends Model if (!($found = cache("{$podcastId}_analytics_podcast_by_country"))) { $found = $this->select('`country_code` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`country_code`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_podcast_by_country", Loading app/Models/AnalyticsPodcastModel.php +2 −6 Original line number Diff line number Diff line Loading @@ -56,9 +56,7 @@ class AnalyticsPodcastModel extends Model public function getDataByMonth(int $podcastId): array { if (!($found = cache("{$podcastId}_analytics_podcast_by_month"))) { $found = $this->select( 'concat(year(`date`),"-",month(`date`),"-01") as `labels`' ) $found = $this->select('DATE_FORMAT(`date`,"%Y-%m-01") as `labels`') ->selectSum('`hits`', '`values`') ->where([ '`podcast_id`' => $podcastId, Loading Loading @@ -124,9 +122,7 @@ class AnalyticsPodcastModel extends Model "{$podcastId}_analytics_podcast_unique_listeners_by_month" )) ) { $found = $this->select( 'concat(year(`date`),"-",month(`date`),"-01") as `labels`' ) $found = $this->select('DATE_FORMAT(`date`,"%Y-%m-01") as `labels`') ->selectSum('`unique_listeners`', '`values`') ->where([ '`podcast_id`' => $podcastId, Loading app/Models/AnalyticsWebsiteByBrowserModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -35,13 +35,13 @@ class AnalyticsWebsiteByBrowserModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_browser"))) { $found = $this->select('`browser` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`browser`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_browser", Loading app/Models/AnalyticsWebsiteByEntryPageModel.php +2 −3 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ class AnalyticsWebsiteByEntryPageModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_entry_page"))) { $found = $this->select('`entry_page` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`entry_page`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_entry_page", Loading app/Models/AnalyticsWebsiteByRefererModel.php +4 −6 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ class AnalyticsWebsiteByRefererModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_referer"))) { $found = $this->select('`referer` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`referer`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_referer", Loading @@ -65,14 +64,13 @@ class AnalyticsWebsiteByRefererModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_domain"))) { $found = $this->select('`domain` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`domain`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_domain", Loading Loading
app/Models/AnalyticsPodcastByCountryModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -35,13 +35,13 @@ class AnalyticsPodcastByCountryModel extends Model if (!($found = cache("{$podcastId}_analytics_podcast_by_country"))) { $found = $this->select('`country_code` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`country_code`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_podcast_by_country", Loading
app/Models/AnalyticsPodcastModel.php +2 −6 Original line number Diff line number Diff line Loading @@ -56,9 +56,7 @@ class AnalyticsPodcastModel extends Model public function getDataByMonth(int $podcastId): array { if (!($found = cache("{$podcastId}_analytics_podcast_by_month"))) { $found = $this->select( 'concat(year(`date`),"-",month(`date`),"-01") as `labels`' ) $found = $this->select('DATE_FORMAT(`date`,"%Y-%m-01") as `labels`') ->selectSum('`hits`', '`values`') ->where([ '`podcast_id`' => $podcastId, Loading Loading @@ -124,9 +122,7 @@ class AnalyticsPodcastModel extends Model "{$podcastId}_analytics_podcast_unique_listeners_by_month" )) ) { $found = $this->select( 'concat(year(`date`),"-",month(`date`),"-01") as `labels`' ) $found = $this->select('DATE_FORMAT(`date`,"%Y-%m-01") as `labels`') ->selectSum('`unique_listeners`', '`values`') ->where([ '`podcast_id`' => $podcastId, Loading
app/Models/AnalyticsWebsiteByBrowserModel.php +2 −2 Original line number Diff line number Diff line Loading @@ -35,13 +35,13 @@ class AnalyticsWebsiteByBrowserModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_browser"))) { $found = $this->select('`browser` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`browser`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_browser", Loading
app/Models/AnalyticsWebsiteByEntryPageModel.php +2 −3 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ class AnalyticsWebsiteByEntryPageModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_entry_page"))) { $found = $this->select('`entry_page` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`entry_page`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_entry_page", Loading
app/Models/AnalyticsWebsiteByRefererModel.php +4 −6 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ class AnalyticsWebsiteByRefererModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_referer"))) { $found = $this->select('`referer` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`referer`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_referer", Loading @@ -65,14 +64,13 @@ class AnalyticsWebsiteByRefererModel extends Model if (!($found = cache("{$podcastId}_analytics_website_by_domain"))) { $found = $this->select('`domain` as `labels`') ->selectSum('`hits`', '`values`') ->groupBy('`domain`') ->where([ '`podcast_id`' => $podcastId, '`date` >' => date('Y-m-d', strtotime('-1 week')), ]) ->groupBy('`labels`') ->orderBy('`values`', 'DESC') ->limit(10) ->findAll(); ->findAll(10); cache()->save( "{$podcastId}_analytics_website_by_domain", Loading