Commit 78db3f05 by dong

fix202302013

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