mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
Allow filter search for country and region.
This commit is contained in:
parent
2ed7628997
commit
a18d1a923c
5 changed files with 55 additions and 17 deletions
|
|
@ -68,6 +68,10 @@ function getDateSQL(field: string, unit: string, timezone?: string) {
|
|||
return `toDateTime(date_trunc('${unit}', ${field}))`;
|
||||
}
|
||||
|
||||
function getSearchSQL(column: string, param: string = 'search'): string {
|
||||
return `and positionCaseInsensitive(${column}, {${param}:String}) > 0`;
|
||||
}
|
||||
|
||||
function mapFilter(column: string, operator: string, name: string, type: string = 'String') {
|
||||
const value = `{${name}:${type}}`;
|
||||
|
||||
|
|
@ -229,6 +233,7 @@ export default {
|
|||
connect,
|
||||
getDateStringSQL,
|
||||
getDateSQL,
|
||||
getSearchSQL,
|
||||
getFilterQuery,
|
||||
getUTCString,
|
||||
parseFilters,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue