Commit 2b494819 by dong

fix

parent df6f773b
...@@ -1104,8 +1104,8 @@ def industry_enterprise(): ...@@ -1104,8 +1104,8 @@ def industry_enterprise():
Company.chain_master == '1' if aptitude == '链主企业' else text(''), Company.chain_master == '1' if aptitude == '链主企业' else text(''),
) )
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:
...@@ -1118,11 +1118,13 @@ def industry_enterprise(): ...@@ -1118,11 +1118,13 @@ def industry_enterprise():
# 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] # 分页
# else:
# size = company.count()
# companys = company.order_by(Company.hots.desc()).paginate(page, perpage).items # 企业热度倒序
if product:
company = Company.query.filter( company = Company.query.filter(
Company.product_all.like('%{}%'.format(product)) Company.product_all.like('%{}%'.format(product))
) )
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