mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Fixed query.
This commit is contained in:
parent
7764f0ee26
commit
7ec84ae7ea
2 changed files with 2 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ async function rawQuery(sql: string, data: object): Promise<any> {
|
||||||
return Promise.reject(new Error('Unknown database.'));
|
return Promise.reject(new Error('Unknown database.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = sql?.replaceAll(/\{\{(\w+)(::\w+)?}}/g, (...args) => {
|
const query = sql?.replaceAll(/\{\{\s*(\w+)(::\w+)?\s*}}/g, (...args) => {
|
||||||
const [, name, type] = args;
|
const [, name, type] = args;
|
||||||
|
|
||||||
params.push(data[name]);
|
params.push(data[name]);
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ async function relationalQuery(
|
||||||
where website_event.website_id = {{websiteId::uuid}}
|
where website_event.website_id = {{websiteId::uuid}}
|
||||||
and website_event.created_at >= {{resetDate}}
|
and website_event.created_at >= {{resetDate}}
|
||||||
and website_event.created_at between {{startDate}} and {{endDate}}
|
and website_event.created_at between {{startDate}} and {{endDate}}
|
||||||
and event_type = {eventType:UInt32}
|
and event_type = {{eventType}}
|
||||||
${filterQuery}
|
${filterQuery}
|
||||||
group by 1
|
group by 1
|
||||||
`,
|
`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue