feat(product-rules): 接单模板列表支持二级目录层级联动筛选

This commit is contained in:
yml2213
2026-09-13 10:51:36 +08:00
parent 447d501f7b
commit 9fcc4ef99d
3 changed files with 240 additions and 37 deletions
@@ -42,7 +42,9 @@ function buildWorkProductRuleWhere({
}
if (categoryId) {
params.push(categoryId)
filters.push(`wpr.category_id = $${params.length}`)
filters.push(
`(wpr.category_id = $${params.length} OR wpr.category_id IN (SELECT id FROM work_categories WHERE parent_id = $${params.length}))`,
)
}
return {
whereClause: filters.length > 0 ? `WHERE ${filters.join(' AND ')}` : '',