mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-16 21: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
|
|
@ -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,
|
||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue