缓存过滤省份

This commit is contained in:
zk
2026-07-13 20:07:00 +08:00
parent 0bb5791cd5
commit 0e10432583
+3 -2
View File
@@ -64,9 +64,10 @@ class DictCacheService:
for m in majors for m in majors
) )
# 地区(市级) # 地区(市级province_code 不为空且 city_code 为空;直辖市取市级避免与省级同名重复
result = await session.execute(text(""" result = await session.execute(text("""
SELECT code, name FROM bg_china_regions_code WHERE city_code IS NULL SELECT code, name FROM bg_china_regions_code
WHERE city_code IS NULL AND province_code IS NOT NULL
""")) """))
self._region_list = [dict(r) for r in result.mappings().all()] self._region_list = [dict(r) for r in result.mappings().all()]