mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Merge branch 'dev' into jajaja
# Conflicts: # pnpm-lock.yaml # src/app/(main)/websites/[websiteId]/events/EventProperties.tsx # src/components/messages.ts # src/lib/constants.ts # src/queries/sql/pageviews/getPageviewMetrics.ts # src/queries/sql/sessions/getWebsiteSessions.ts
This commit is contained in:
commit
a9a9b57f80
10 changed files with 356 additions and 90 deletions
|
|
@ -18,6 +18,12 @@ async function relationalQuery(websiteId: string, column: string, filters: Query
|
|||
const { startDate, endDate, search } = filters;
|
||||
|
||||
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(',')) {
|
||||
|
|
@ -46,6 +52,7 @@ async function relationalQuery(websiteId: string, column: string, filters: Query
|
|||
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
|
||||
|
|
@ -66,6 +73,11 @@ async function clickhouseQuery(websiteId: string, column: string, filters: Query
|
|||
const { startDate, endDate, search } = filters;
|
||||
|
||||
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`;
|
||||
|
|
@ -96,6 +108,7 @@ async function clickhouseQuery(websiteId: string, column: string, filters: Query
|
|||
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