|
|
|
@ -338,6 +338,7 @@ def add_limit_2query_body(limit_query: Union[List[dict], dict], body_key: str, q
|
|
|
|
# 相同的Key类型只能有一个,如果同类型有多个条件,需要追加到Items[]内,还不能重复
|
|
|
|
# 相同的Key类型只能有一个,如果同类型有多个条件,需要追加到Items[]内,还不能重复
|
|
|
|
child_items = group["ChildItems"]
|
|
|
|
child_items = group["ChildItems"]
|
|
|
|
if group["Key"] == body_key:
|
|
|
|
if group["Key"] == body_key:
|
|
|
|
|
|
|
|
extended = False
|
|
|
|
if not child_items:
|
|
|
|
if not child_items:
|
|
|
|
# 直接添加进去
|
|
|
|
# 直接添加进去
|
|
|
|
if isinstance(limit_query, dict):
|
|
|
|
if isinstance(limit_query, dict):
|
|
|
|
@ -346,6 +347,7 @@ def add_limit_2query_body(limit_query: Union[List[dict], dict], body_key: str, q
|
|
|
|
group["ChildItems"].extend(limit_query)
|
|
|
|
group["ChildItems"].extend(limit_query)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise ValueError("不支持的limit类型 \n%s" % limit_query)
|
|
|
|
raise ValueError("不支持的limit类型 \n%s" % limit_query)
|
|
|
|
|
|
|
|
extended = True
|
|
|
|
break
|
|
|
|
break
|
|
|
|
for child_item in child_items:
|
|
|
|
for child_item in child_items:
|
|
|
|
# 对child_item['Items']的值进行过滤,只添加不重复的
|
|
|
|
# 对child_item['Items']的值进行过滤,只添加不重复的
|
|
|
|
@ -362,9 +364,16 @@ def add_limit_2query_body(limit_query: Union[List[dict], dict], body_key: str, q
|
|
|
|
for limit_query_item in limit_query['Items']:
|
|
|
|
for limit_query_item in limit_query['Items']:
|
|
|
|
# 如果新的条件已存在,跳过
|
|
|
|
# 如果新的条件已存在,跳过
|
|
|
|
if child_item_map.get(limit_query_item['Field'], {}).get(limit_query_item["Key"]):
|
|
|
|
if child_item_map.get(limit_query_item['Field'], {}).get(limit_query_item["Key"]):
|
|
|
|
|
|
|
|
# 重复也相当于追加过
|
|
|
|
|
|
|
|
extended = True
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
child_item['Items'].append(limit_query_item)
|
|
|
|
child_item['Items'].append(limit_query_item)
|
|
|
|
|
|
|
|
extended = True
|
|
|
|
|
|
|
|
if not extended:
|
|
|
|
|
|
|
|
child_items.append(limit_query)
|
|
|
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
break
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|