mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
change pagestable to visitors and update clickhouse hostname column to array
This commit is contained in:
parent
195619aeed
commit
2dcb9e21bd
8 changed files with 296 additions and 29 deletions
|
|
@ -21,6 +21,12 @@ async function relationalQuery(
|
|||
const { rawQuery, getSearchSQL } = prisma;
|
||||
const params = {};
|
||||
let searchQuery = '';
|
||||
let excludeDomain = '';
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and website_event.referrer_domain != website_event.hostname
|
||||
and website_event.referrer_domain != ''`;
|
||||
}
|
||||
|
||||
if (search) {
|
||||
if (decodeURIComponent(search).includes(',')) {
|
||||
|
|
@ -49,6 +55,7 @@ async function relationalQuery(
|
|||
where website_event.website_id = {{websiteId::uuid}}
|
||||
and website_event.created_at between {{startDate}} and {{endDate}}
|
||||
${searchQuery}
|
||||
${excludeDomain}
|
||||
group by 1
|
||||
order by 2 desc
|
||||
limit 10
|
||||
|
|
@ -73,6 +80,11 @@ async function clickhouseQuery(
|
|||
const { rawQuery, getSearchSQL } = clickhouse;
|
||||
const params = {};
|
||||
let searchQuery = '';
|
||||
let excludeDomain = '';
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and referrer_domain != hostname and referrer_domain != ''`;
|
||||
}
|
||||
|
||||
if (search) {
|
||||
searchQuery = `and positionCaseInsensitive(${column}, {search:String}) > 0`;
|
||||
|
|
@ -103,6 +115,7 @@ async function clickhouseQuery(
|
|||
where website_id = {websiteId:UUID}
|
||||
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
${searchQuery}
|
||||
${excludeDomain}
|
||||
group by 1
|
||||
order by 2 desc
|
||||
limit 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue