|
@@ -66,8 +66,11 @@ class APNConfigView(View):
|
|
|
if not language:
|
|
|
language = LanguageModel.objects.filter(lang='en').first()
|
|
|
|
|
|
+ iso_list = CountryAPN.objects.all().values("iso")
|
|
|
# 查询tb_country_language和tb_country,获取国家名称和国家iso2代码
|
|
|
- countries = CountryLanguageModel.objects.filter(language=language).select_related('country').order_by(
|
|
|
+ countries = CountryLanguageModel.objects.filter(language=language,
|
|
|
+ country__country_code__in=iso_list).select_related(
|
|
|
+ 'country').order_by(
|
|
|
'country__country_name')
|
|
|
|
|
|
# 返回国家名和对应的 country_code
|