Commit 2b494819 by dong

fix

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