mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
PR comments
This commit is contained in:
parent
1c26581cd1
commit
f569055771
3 changed files with 21 additions and 26 deletions
|
|
@ -38,7 +38,7 @@ async function relationalQuery(
|
|||
return rawQuery(
|
||||
`
|
||||
select ${getDateQuery('pageview.created_at', unit, timezone)} t,
|
||||
count(${count != '*' ? `${count}${sessionKey}` : count}) y
|
||||
count(${count !== '*' ? `${count}${sessionKey}` : count}) y
|
||||
from pageview
|
||||
${joinSession}
|
||||
where pageview.website_id=$1
|
||||
|
|
@ -78,7 +78,7 @@ async function clickhouseQuery(
|
|||
from
|
||||
(select
|
||||
${getDateQueryClickhouse('created_at', unit, timezone)} t,
|
||||
count(${count != '*' ? `${count}${sessionKey}` : count}) y
|
||||
count(${count !== '*' ? `${count}${sessionKey}` : count}) y
|
||||
from pageview
|
||||
${joinSession}
|
||||
where pageview.website_id= $1
|
||||
|
|
|
|||
|
|
@ -31,24 +31,19 @@ async function relationalQuery(website_id, start_at, end_at, filters = {}) {
|
|||
select sum(t.c) as "pageviews",
|
||||
count(distinct t.session_id) as "uniques",
|
||||
sum(case when t.c = 1 then 1 else 0 end) as "bounces",
|
||||
sum(case when m2 < m1 + interval '1 hour' then ${getTimestampInterval(
|
||||
'm2',
|
||||
'm1',
|
||||
)} else 0 end) as "totaltime"
|
||||
sum(t.time) as "totaltime"
|
||||
from (
|
||||
select
|
||||
pageview.session_id,
|
||||
${getDateQuery('pageview.created_at', 'hour')},
|
||||
count(*) c,
|
||||
min(created_at) m1,
|
||||
max(created_at) m2
|
||||
from pageview
|
||||
${joinSession}
|
||||
where pageview.website_id=$1
|
||||
and pageview.created_at between $2 and $3
|
||||
${pageviewQuery}
|
||||
${sessionQuery}
|
||||
group by 1, 2
|
||||
select pageview.session_id,
|
||||
${getDateQuery('pageview.created_at', 'hour')},
|
||||
count(*) c,
|
||||
${getTimestampInterval('pageview.created_at')} as "time"
|
||||
from pageview
|
||||
${joinSession}
|
||||
where pageview.website_id=$1
|
||||
and pageview.created_at between $2 and $3
|
||||
${pageviewQuery}
|
||||
${sessionQuery}
|
||||
group by 1, 2
|
||||
) t
|
||||
`,
|
||||
params,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue