tag fix
This commit is contained in:
@@ -29,6 +29,7 @@ export async function GET(request: NextRequest) {
|
||||
const teamIds = searchParams.getAll('teamId');
|
||||
const projectIds = searchParams.getAll('projectId');
|
||||
const tagIds = searchParams.getAll('tagId');
|
||||
const tagNames = searchParams.getAll('tagName');
|
||||
|
||||
// 获取UTM类型参数
|
||||
const utmType = searchParams.get('utmType') || 'source';
|
||||
@@ -72,9 +73,12 @@ export async function GET(request: NextRequest) {
|
||||
}
|
||||
|
||||
// 添加标签筛选
|
||||
if (tagIds && tagIds.length > 0) {
|
||||
if ((tagIds && tagIds.length > 0) || (tagNames && tagNames.length > 0)) {
|
||||
// 优先使用tagNames,如果有的话
|
||||
const tagsToUse = tagNames.length > 0 ? tagNames : tagIds;
|
||||
|
||||
// 使用与buildFilter函数相同的处理方式
|
||||
const tagConditions = tagIds.map(tag =>
|
||||
const tagConditions = tagsToUse.map(tag =>
|
||||
`link_tags LIKE '%${tag}%'`
|
||||
);
|
||||
conditions.push(`(${tagConditions.join(' OR ')})`);
|
||||
|
||||
Reference in New Issue
Block a user