mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 19:17:45 +02:00
fix: correct chart data
This commit is contained in:
parent
769ea469c9
commit
4d3e9c8c02
5 changed files with 12 additions and 19 deletions
|
|
@ -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",
|
||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue