Fix utm request

pull/1356/head
biqette 2022-07-26 18:49:38 +02:00
parent f1717ce533
commit c8302390c5
1 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ export async function getPageviewParams(...args) {
} }
function relationalQuery(param, website_id, start_at, end_at, column, table, filters = {}) { function relationalQuery(param, website_id, start_at, end_at, column, table, filters = {}) {
const params = [param, website_id, start_at, end_at]; const params = [param, param, website_id, start_at, end_at];
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters( const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
table, table,
column, column,
@ -26,12 +26,13 @@ function relationalQuery(param, website_id, start_at, end_at, column, table, fil
return rawQuery( return rawQuery(
`select * from ( `select * from (
select select
url, ${splitFn}(${splitFn}(url, concat($1, '='), 2), '&', 1) param url,
IF( LENGTH(url) - LENGTH(${splitFn}(url, concat($1, '='), -1)) > 1, ${splitFn}(${splitFn}(url, concat($2, '='), -1), '&', 1), null ) param
from from
pageview pageview
${joinSession} ${joinSession}
where where
${table}.website_id=$2 and ${table}.created_at between $3 and $4 ${table}.website_id=$3 and ${table}.created_at between $4 and $5
${pageviewQuery} ${pageviewQuery}
${joinSession && sessionQuery} ${joinSession && sessionQuery}
${eventQuery} ${eventQuery}