Commit eb1392ba by dong

fix20230331

parent fd8029fb
...@@ -413,11 +413,12 @@ def attract_enterprise(): ...@@ -413,11 +413,12 @@ def attract_enterprise():
return jsonify(code=RET.PARAMERR, msg="参数不完整") return jsonify(code=RET.PARAMERR, msg="参数不完整")
try: try:
enterprise = Enterprise.query.filter(or_( if not product:
Enterprise.c_type == inid, enterprise = Enterprise.query.filter(or_(
Enterprise.c_type1 == inid, Enterprise.c_type == inid,
Enterprise.c_type2 == inid Enterprise.c_type1 == inid,
)) Enterprise.c_type2 == inid
))
enterprise_obj = enterprise.filter( enterprise_obj = enterprise.filter(
# Enterprise.product_all.like("%{}%".format(product)) if product else text(''), # Enterprise.product_all.like("%{}%".format(product)) if product else text(''),
...@@ -446,9 +447,12 @@ def attract_enterprise(): ...@@ -446,9 +447,12 @@ def attract_enterprise():
for product in product_li: for product in product_li:
enterprise2 = '' enterprise2 = ''
enterprise2 = enterprise.filter(or_( enterprise2 = enterprise.filter(or_(
Enterprise.product_all.like("%{}%".format(product)), (Enterprise.product_all.like("%{}%".format(product)),
Enterprise.product_all1.like("%{}%".format(product)), Enterprise.c_type == inid),
Enterprise.product_all2.like("%{}%".format(product)) (Enterprise.product_all1.like("%{}%".format(product)),
Enterprise.c_type1 == inid),
(Enterprise.product_all2.like("%{}%".format(product)),
Enterprise.c_type2 == inid)
)).all() )).all()
company1 += enterprise2 company1 += enterprise2
company1 = set(company1) company1 = set(company1)
......
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