Commit 5e7586e9 by dong

fix20221210

parent 92dd2c26
......@@ -71,9 +71,10 @@ def advice():
page = req_dict.get("page")
perpage = req_dict.get("perpage")
if not any([product, budget, preference, revenue, tax, address]):
return jsonify(code=RET.DATAERR, msg="数据不全")
if not any([key_words, product, budget, preference, revenue, tax, address]):
return jsonify(code=RET.PARAMERR, msg="无有效参数!")
try:
if key_words:
zone = Induzone.query.filter(
and_(
Induzone.district == address if address and address != '晋城市' else text(''),
......@@ -89,6 +90,14 @@ def advice():
Induzone.charge.like("%" + key_words + "%") if key_words else text(''),
Induzone.address.like("%" + key_words + "%") if key_words else text('')
))
else:
zone = Induzone.query.filter(
Induzone.district == address if address and address != '晋城市' else text(''),
Induzone.navigat.like('%{}%'.format(product)) if product else text(''),
Induzone.invest_power < float(budget) if budget else text(''),
Induzone.cate == "产业园区",
Induzone.tax < tax if tax else text('')
)
if industry_id:
indu = Industry.query.filter_by(nid=industry_id).first()
if not indu:
......
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