Commit 433870b2 authored by lvshibao's avatar lvshibao

scores页面修改

parent a77bb5e9
...@@ -54,7 +54,7 @@ class TasksApi(viewsets.ViewSet): ...@@ -54,7 +54,7 @@ class TasksApi(viewsets.ViewSet):
seat_ids = SeatStat.objects.filter(**session_condition).values_list('agentName', flat=True) seat_ids = SeatStat.objects.filter(**session_condition).values_list('agentName', flat=True)
seat_id_names = Seat.objects.filter(code__in=seat_ids).values('code', 'name') seat_id_names = Seat.objects.filter(code__in=seat_ids).values('code', 'name')
seat_ids_with_name = [x['code'] for x in seat_id_names] seat_ids_with_name = [x['code'] for x in seat_id_names]
extra = [({'code': seat_id, 'name': seat_id} for seat_id in seat_ids if seat_id not in seat_ids_with_name)] extra = [{'code': seat_id, 'name': seat_id} for seat_id in seat_ids if seat_id not in seat_ids_with_name]
return Response({'code': 0, 'msg': 'success', 'data': list(seat_id_names) + extra}) return Response({'code': 0, 'msg': 'success', 'data': list(seat_id_names) + extra})
@action(['post'], detail=False) @action(['post'], detail=False)
...@@ -463,7 +463,8 @@ class TasksApi(viewsets.ViewSet): ...@@ -463,7 +463,8 @@ class TasksApi(viewsets.ViewSet):
task_condition['task__in'] = team_names task_condition['task__in'] = team_names
call_count = SeatStat.objects.filter(**task_condition).aggregate(Sum("validate_session"))['validate_session__sum'] call_count = SeatStat.objects.filter(**task_condition).aggregate(Sum("validate_session"))[
'validate_session__sum']
# tasks = RulesStat.objects.filter(**task_condition).values('rule', 'sessionCollectionId', 'rule_num') # tasks = RulesStat.objects.filter(**task_condition).values('rule', 'sessionCollectionId', 'rule_num')
tasks = RulesStat.objects.all().filter(**task_condition) \ tasks = RulesStat.objects.all().filter(**task_condition) \
......
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