Commit cc7c428d by dong

fix202302014

parent 0eb8f89f
...@@ -140,30 +140,25 @@ def industry_cluster(): ...@@ -140,30 +140,25 @@ 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 company_count = Company.query.filter(
).count() Company.product_all.like('%{}%'.format(chain_name)),
else: Company.c_type == industry_id,
company_count = Company.query.filter( ).count()
Company.product_all.like('%{}%'.format(chain_name)),
Company.c_type == industry_id,
).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 chain_obj = IndustryChain.query.filter(
else: IndustryChain.industry_name == chain_name,
chain_obj = IndustryChain.query.filter( IndustryChain.chain_id == industry_id,
IndustryChain.industry_name == chain_name, ).first()
IndustryChain.chain_id == industry_id, company_count = chain_obj.enterprise_num
).first()
company_count = chain_obj.enterprise_num
return company_count return company_count
......
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