Commit 9d355ce3 authored by lvshibao's avatar lvshibao

添加get获取参数

parent bb0e2d82
......@@ -39,14 +39,14 @@ def get_city_country_team():
def db_static_score(req):
city_id = req.data.get('city', None)
country_id = req.data.get('country', None)
city_id = req.data.get('city', None) if 'city' in req.data else req.GET.get('city', None)
country_id = req.data.get('country', None) if 'country' in req.data else req.GET.get('country', None)
task_condition = req.data.get('date_condition', {})
team_names = get_team_names(city_id, country_id)
task_condition['task__in'] = team_names
sort = req.data.get('sort', '-avg_score')
sort = req.data.get('sort', '-avg_score') if 'sort' in req.data else req.GET.get('sort', None)
all_scores = ScoreStat.objects.filter(**task_condition).extra(select={'area': "task"}).values('area').annotate(
avg_score_svc=Round(Avg('service_score'), 2), avg_score_bus=Round(Avg('business_score'), 2),
......@@ -56,11 +56,11 @@ def db_static_score(req):
def db_seat_rule(req, if_page=False):
city_id = req.data.get('city', None)
country_id = req.data.get('country', None)
team_id = req.data.get('team', None)
agent_name = req.data.get('seat', '')
sort = req.data.get('sort', 'des')
city_id = req.data.get('city', None) if 'city' in req.data else req.GET.get('city', None)
country_id = req.data.get('country', None) if 'country' in req.data else req.GET.get('country', None)
team_id = req.data.get('team', None) if 'team' in req.data else req.GET.get('team', None)
agent_name = req.data.get('seat', '') if 'seat' in req.data else req.GET.get('team', '')
sort = req.data.get('sort', 'des') if 'sort' in req.data else req.GET.get('sort', 'des')
task_condition = req.data.get('date_condition', {})
team_names = get_team_names(city_id, country_id, team_id)
......@@ -119,10 +119,10 @@ def db_seat_rule(req, if_page=False):
def db_seat_check(req, if_page=False):
city_id = req.data.get('city', '')
country_id = req.data.get('country', '')
team_id = req.data.get('team', '')
agent_name = req.data.get('agentName', '')
city_id = req.data.get('city', '') if 'city' in req.data else req.GET.get('city', '')
country_id = req.data.get('country', '') if 'country' in req.data else req.GET.get('country', '')
team_id = req.data.get('team', '') if 'team' in req.data else req.GET.get('team', '')
agent_name = req.data.get('agentName', '') if 'agentName' in req.data else req.GET.get('agentName', '')
task_condition = req.data.get('at_condition', {})
task_condition['hasCheck'] = 1
......@@ -210,12 +210,12 @@ def db_seat_check(req, if_page=False):
def db_seat_area(req):
city_id = req.data.get('city', None)
country_id = req.data.get('country', None)
team_id = req.data.get('team', None)
agent_name = req.data.get('seat', '')
sort = req.data.get('sort', '-avg_score')
task_condition = req.data.get('date_condition', '')
city_id = req.data.get('city', None) if 'city' in req.data else req.GET.get('city', None)
country_id = req.data.get('country', None) if 'country' in req.data else req.GET.get('country', None)
team_id = req.data.get('team', None) if 'team' in req.data else req.GET.get('team', None)
agent_name = req.data.get('seat', '') if 'seat' in req.data else req.GET.get('seat', '')
sort = req.data.get('sort', '-avg_score') if 'sort' in req.data else req.GET.get('sort', '-avg_score')
task_condition = req.data.get('date_condition', {})
team_names = get_team_names(city_id, country_id, team_id)
......@@ -235,9 +235,9 @@ def db_seat_area(req):
def db_static_rule(req):
city_id = req.data.get('city', None)
country_id = req.data.get('country', None)
team_id = req.data.get('team', None)
city_id = req.data.get('city', None) if 'city_id' in req.data else req.GET.get('city', None)
country_id = req.data.get('country', None) if 'country' in req.data else req.GET.get('country', None)
team_id = req.data.get('team', None) if 'team' in req.data else req.GET.get('team', None)
team_names = get_team_names(city_id, country_id, team_id)
......
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