Commit 4316bbf1 authored by lvshibao's avatar lvshibao

获取team修改

parent 0ffd587c
...@@ -44,6 +44,13 @@ class AgencyApi(viewsets.ViewSet): ...@@ -44,6 +44,13 @@ class AgencyApi(viewsets.ViewSet):
for city in cities: for city in cities:
city_list.append({'id': city.id, 'name': city.name}) city_list.append({'id': city.id, 'name': city.name})
countries = Country.objects.exclude(parent=city_id).exclude(parent=None).all()
if len(countries) > 0:
for country in countries:
if len(Team.objects.filter(country=country.id).all()) > 0:
country_list.append({'id': country.id, 'name': country.name})
else: else:
city_list.append({'id': top.id, 'name': top.name}) city_list.append({'id': top.id, 'name': top.name})
countries = Country.objects.filter(parent=top.id).all() countries = Country.objects.filter(parent=top.id).all()
......
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