Commit df6f773b by dong

fix

parent f5b98ec4
...@@ -1106,18 +1106,22 @@ def industry_enterprise(): ...@@ -1106,18 +1106,22 @@ def industry_enterprise():
if product: if product:
# 点击上级环节,展示本级所有企业 # 点击上级环节,展示本级所有企业
product_li = get_product_li(product, inid) # product_li = get_product_li(product, inid)
company1 = [] # company1 = []
for product in product_li: # for product in product_li:
company2 = company.filter( # company2 = company.filter(
Company.c_type == inid, # Company.c_type == inid,
Company.product_all.like("%{}%".format(product)) # Company.product_all.like("%{}%".format(product))
).all() # ).all()
company1 += company2 # company1 += company2
company1 = set(company1) # company1 = set(company1)
size = len(company1) # size = len(company1)
company1 = sorted(company1, key=lambda x: x.hots, reverse=True) # 排序 # company1 = sorted(company1, key=lambda x: x.hots, reverse=True) # 排序
companys = company1[(page - 1) * perpage:page * perpage] # 分页 # companys = company1[(page - 1) * perpage:page * perpage] # 分页
company = Company.query.filter(
Company.product_all.like('%{}%'.format(product))
)
else: else:
size = company.count() size = company.count()
companys = company.order_by(Company.hots.desc()).paginate(page, perpage).items # 企业热度倒序 companys = company.order_by(Company.hots.desc()).paginate(page, perpage).items # 企业热度倒序
......
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