mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
fix hasdata queries, add hasData to website events, fix sessionactivity truncation,
This commit is contained in:
parent
9230f3cb7b
commit
f3e246c64b
5 changed files with 60 additions and 24 deletions
|
|
@ -19,20 +19,20 @@ async function relationalQuery(websiteId: string, eventId: string) {
|
|||
|
||||
return rawQuery(
|
||||
`
|
||||
select website_id as "websiteId",
|
||||
session_id as "sessionId",
|
||||
event_id as "eventId",
|
||||
url_path as "urlPath",
|
||||
event_name as "eventName",
|
||||
data_key as "dataKey",
|
||||
string_value as "stringValue",
|
||||
number_value as "numberValue",
|
||||
date_value as "dateValue",
|
||||
data_type as "dataType",
|
||||
created_at as "createdAt"
|
||||
select event_data.website_id as "websiteId",
|
||||
event_data.website_event_id as "eventId",
|
||||
website_event.event_name as "eventName",
|
||||
event_data.data_key as "dataKey",
|
||||
event_data.string_value as "stringValue",
|
||||
event_data.number_value as "numberValue",
|
||||
event_data.date_value as "dateValue",
|
||||
event_data.data_type as "dataType",
|
||||
event_data.created_at as "createdAt"
|
||||
from event_data
|
||||
website_id = {{websiteId::uuid}}
|
||||
event_id = {{eventId::uuid}}
|
||||
join website_event on website_event.event_id = event_data.website_event_id
|
||||
and website_event.website_id = {{websiteId::uuid}}
|
||||
where event_data.website_id = {{websiteId::uuid}}
|
||||
and event_data.website_event_id = {{eventId::uuid}}
|
||||
`,
|
||||
{ websiteId, eventId },
|
||||
FUNCTION_NAME,
|
||||
|
|
@ -45,9 +45,7 @@ async function clickhouseQuery(websiteId: string, eventId: string): Promise<Even
|
|||
return rawQuery(
|
||||
`
|
||||
select website_id as websiteId,
|
||||
session_id as sessionId,
|
||||
event_id as eventId,
|
||||
url_path as urlPath,
|
||||
event_name as eventName,
|
||||
data_key as dataKey,
|
||||
string_value as stringValue,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
|
|||
browser as browser,
|
||||
page_title as "pageTitle",
|
||||
website_event.event_type as "eventType",
|
||||
website_event.event_name as "eventName"
|
||||
website_event.event_name as "eventName",
|
||||
event_id IN (select website_event_id
|
||||
from event_data
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and created_at between {{startDate}} and {{endDate}}) AS "hasData"
|
||||
from website_event
|
||||
${cohortQuery}
|
||||
join session on session.session_id = website_event.session_id
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ async function relationalQuery(websiteId: string, sessionId: string, filters: Qu
|
|||
event_type as "eventType",
|
||||
event_name as "eventName",
|
||||
visit_id as "visitId",
|
||||
event_id IN (select event_id
|
||||
event_id IN (select website_event_id
|
||||
from event_data
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and session_id = {{sessionId::uuid}}) AS "hasData"
|
||||
and created_at between {{startDate}} and {{endDate}}) AS "hasData"
|
||||
from website_event
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and session_id = {{sessionId::uuid}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue