Commit ad4c057b by dong

fix20220519

parent 1499df03
...@@ -409,8 +409,11 @@ def recommond(): ...@@ -409,8 +409,11 @@ def recommond():
# 校验参数完整性 # 校验参数完整性
# if not all([name]): # if not all([name]):
# return jsonify(code=RET.PARAMERR, msg="参数不完整") # return jsonify(code=RET.PARAMERR, msg="参数不完整或者无数据")
try: try:
if not name:
return jsonify(code=RET.OK, msg="查无数据!")
enterprise = Enterprise.query.filter(Enterprise.city !='晋城市', Enterprise.product_all.like("%{}%".format(name))) enterprise = Enterprise.query.filter(Enterprise.city !='晋城市', Enterprise.product_all.like("%{}%".format(name)))
size = enterprise.count() size = enterprise.count()
enterprise = enterprise.order_by(Enterprise.c_type, Enterprise.hots.desc()).paginate(page, enterprise = enterprise.order_by(Enterprise.c_type, Enterprise.hots.desc()).paginate(page,
......
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