Commit 01b2e485 authored by lvshibao's avatar lvshibao

rule_detail 根据用户名筛选

parent a1872f7b
...@@ -539,7 +539,7 @@ class TasksApi(viewsets.ViewSet): ...@@ -539,7 +539,7 @@ class TasksApi(viewsets.ViewSet):
session_condition = {'create_date__gte': q_start_date, 'create_date__lt': q_end_date, 'rule': rule_name, session_condition = {'create_date__gte': q_start_date, 'create_date__lt': q_end_date, 'rule': rule_name,
'sessionCollectionId__in': table_list} 'sessionCollectionId__in': table_list}
if username in name_list: if username in name_list:
session_condition['agentName__iregex'] = '*' + name_code_dict[username] + '*' session_condition['agentName__contains'] = name_code_dict[username]
checks = RulesStat.objects.filter(**session_condition).values('agentName', 'customName', 'remainTime', 'score', checks = RulesStat.objects.filter(**session_condition).values('agentName', 'customName', 'remainTime', 'score',
'sessionCollectionId', 'sessionId', 'taskId') 'sessionCollectionId', 'sessionId', 'taskId')
paginator = Paginator(checks, page_size) paginator = Paginator(checks, page_size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment