mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
pass timezone in stats CH query
This commit is contained in:
parent
bba584a09f
commit
a219f5dbe3
2 changed files with 6 additions and 6 deletions
|
|
@ -41,7 +41,7 @@ async function clickhouseQuery(
|
|||
websiteId: string,
|
||||
filters: QueryFilters,
|
||||
): Promise<{ x: string; y: number }[]> {
|
||||
const { unit = 'day' } = filters;
|
||||
const { timezone = 'utc', unit = 'day' } = filters;
|
||||
const { parseFilters, rawQuery } = clickhouse;
|
||||
const { filterQuery, params } = await parseFilters(websiteId, {
|
||||
...filters,
|
||||
|
|
@ -57,7 +57,7 @@ async function clickhouseQuery(
|
|||
g.y as y
|
||||
from (
|
||||
select
|
||||
date_trunc('${unit}', created_at) as t,
|
||||
date_trunc('${unit}', created_at, '${timezone}') as t,
|
||||
count(*) as y
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
@ -75,7 +75,7 @@ async function clickhouseQuery(
|
|||
g.y as y
|
||||
from (
|
||||
select
|
||||
date_trunc('${unit}', created_at) as t,
|
||||
date_trunc('${unit}', created_at, '${timezone}') as t,
|
||||
sum(views)as y
|
||||
from website_event_stats_hourly website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ async function clickhouseQuery(
|
|||
websiteId: string,
|
||||
filters: QueryFilters,
|
||||
): Promise<{ x: string; y: number }[]> {
|
||||
const { unit = 'day' } = filters;
|
||||
const { timezone = 'utc', unit = 'day' } = filters;
|
||||
const { parseFilters, rawQuery } = clickhouse;
|
||||
const { filterQuery, params } = await parseFilters(websiteId, {
|
||||
...filters,
|
||||
|
|
@ -57,7 +57,7 @@ async function clickhouseQuery(
|
|||
g.y as y
|
||||
from (
|
||||
select
|
||||
date_trunc('${unit}', created_at) as t,
|
||||
date_trunc('${unit}', created_at, '${timezone}') as t,
|
||||
count(distinct session_id) as y
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
@ -75,7 +75,7 @@ async function clickhouseQuery(
|
|||
g.y as y
|
||||
from (
|
||||
select
|
||||
date_trunc('${unit}', created_at) as t,
|
||||
date_trunc('${unit}', created_at, '${timezone}') as t,
|
||||
uniq(session_id) as y
|
||||
from website_event_stats_hourly website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue