Commit 8f44c252 authored by lvshibao's avatar lvshibao

group页面修改

parent e8c78f8a
......@@ -47,14 +47,10 @@ class AgencyApi(viewsets.ViewSet):
city_list.append({'id': top.id, 'name': top.name})
countries = Country.objects.filter(parent=top.id).all()
country_id_list = list()
if len(countries) > 0:
for country in countries:
print(country.name)
if len(Team.objects.filter(country=country.id).all()) > 0:
country_list.append({'id': country.id, 'name': country.name})
country_id_list.append(country.id)
return_data = {'city_list': city_list, 'country_list': country_list, 'city_id': city_id}
......@@ -76,6 +72,7 @@ class AgencyApi(viewsets.ViewSet):
else:
countries = Country.objects.filter(parent=city_id).all()
for country in countries:
if len(Team.objects.filter(country=country.id).all()) > 0:
country_list.append({'id': country.id, 'name': country.name})
return Response({'code': 0, 'msg': 'success', 'data': {'country_list': country_list}})
else:
......
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