fix(analytics): remove charts empty values + remove useless language cache

fix(install): edit host_url helper and remove back() when create .env
This commit is contained in:
Benjamin Bellamy 2020-10-19 16:47:22 +00:00
commit 1678794153
8 changed files with 21 additions and 21 deletions

View file

@ -33,7 +33,9 @@ class AnalyticsWebsiteByEntryPageModel extends Model
public function getData(int $podcastId): array
{
if (!($found = cache("{$podcastId}_analytics_website_by_entry_page"))) {
$found = $this->select('`entry_page` as `labels`')
$found = $this->select(
'IF(`entry_page`=\'/\',\'/\',SUBSTRING_INDEX(`entry_page`,\'/\',-1)) as `labels`'
)
->selectSum('`hits`', '`values`')
->where([
'`podcast_id`' => $podcastId,