click subpath
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createClient } from '@clickhouse/client';
|
||||
import type { EventsQueryParams } from './types';
|
||||
import { EventsQueryParams } from './analytics';
|
||||
|
||||
// ClickHouse 客户端配置
|
||||
const clickhouse = createClient({
|
||||
@@ -58,6 +58,13 @@ export function buildFilter(params: Partial<EventsQueryParams>): string {
|
||||
filters.push(`user_id = '${params.userId}'`);
|
||||
}
|
||||
|
||||
// 添加子路径过滤条件
|
||||
if (params.subpath) {
|
||||
console.log('Adding subpath filter:', params.subpath);
|
||||
// 使用 url 字段和字符串函数替代不存在的 path 字段
|
||||
filters.push(`positionCaseInsensitive(url, '/${params.subpath}') > 0`);
|
||||
}
|
||||
|
||||
// 添加团队ID过滤条件
|
||||
if (params.teamId) {
|
||||
filters.push(`team_id = '${params.teamId}'`);
|
||||
|
||||
Reference in New Issue
Block a user