Commit cc7c428d by dong

fix202302014

parent 0eb8f89f
...@@ -140,25 +140,20 @@ def industry_cluster(): ...@@ -140,25 +140,20 @@ def industry_cluster():
def get_count(industry_id, chain_name, flag): def get_count(industry_id, chain_name, flag):
company_count = '' company_count = ''
if flag == 1: # 晋城 if flag == 1: # 晋城
if chain_name in ["钢铁", "光机电", "煤层气", "装备制造", "铸造", # if industry_id in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]:
"煤化工", "新材料", "绿色建材", "医药", "丝麻纺织服装", # company_count = Company.query.filter(
"现代服务业", "数字经济", "文化旅游"]: # Company.c_type == industry_id
company_count = Company.query.filter( # ).count()
# Company.product_all.like('%{}%'.format(chain_name)), # else:
Company.c_type == industry_id
).count()
else:
company_count = Company.query.filter( company_count = Company.query.filter(
Company.product_all.like('%{}%'.format(chain_name)), Company.product_all.like('%{}%'.format(chain_name)),
Company.c_type == industry_id, Company.c_type == industry_id,
).count() ).count()
if flag == 2: # 全国 if flag == 2: # 全国
if chain_name in ["钢铁", "光机电", "煤层气", "装备制造", "铸造", # if industry_id in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]:
"煤化工", "新材料", "绿色建材", "医药", "丝麻纺织服装", # chain_obj = IndustryChain.query.get(industry_id)
"现代服务业", "数字经济", "文化旅游"]: # company_count = chain_obj.enterprise_num
chain_obj = IndustryChain.query.get(id=industry_id) # else:
company_count = chain_obj.enterprise_num
else:
chain_obj = IndustryChain.query.filter( chain_obj = IndustryChain.query.filter(
IndustryChain.industry_name == chain_name, IndustryChain.industry_name == chain_name,
IndustryChain.chain_id == industry_id, IndustryChain.chain_id == industry_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