fix(sqlbuilder): 处理 reseller_id_eq 和 plan_id_eq 过滤条件逻辑
- 添加逻辑判断当存在 plan_id_eq 过滤条件时 - 删除与 creator 相关的过滤条件 creator_in 和 creator_ids - 优化过滤条件组合,避免冲突和冗余 - 保持现有 merchant_id_in 条件处理逻辑不变
This commit is contained in:
parent
57a32855fc
commit
bca7892799
|
|
@ -397,6 +397,12 @@ func BuildSQLWithFields(req BuildRequest, whitelist map[string]bool) (string, []
|
|||
}
|
||||
}
|
||||
if v, ok := req.Filters["reseller_id_eq"]; ok {
|
||||
// 如果提供了 reseller_id_eq 或 activity_id_eq,则不保留 creator 相关的过滤条件
|
||||
if _, hasPlan := req.Filters["plan_id_eq"]; hasPlan {
|
||||
// 删除 creator 相关条件
|
||||
delete(req.Filters, "creator_in")
|
||||
delete(req.Filters, "creator_ids")
|
||||
}
|
||||
// If merchant_id_in is present, it handles the merchant_id logic (via OR condition),
|
||||
if _, hasIn := req.Filters["merchant_id_in"]; !hasIn {
|
||||
s := utils.ToString(v)
|
||||
|
|
|
|||
Loading…
Reference in New Issue