Commit cc7c428d by dong

fix202302014

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