Commit 672251b1 by 赵宇

'fix'

parent fa9bbc3e
...@@ -141,12 +141,13 @@ def industry_enterprise(): ...@@ -141,12 +141,13 @@ def industry_enterprise():
req_dict = request.get_json() req_dict = request.get_json()
inid = req_dict.get("inid") # 行业id inid = req_dict.get("inid") # 行业id
industry_level = req_dict.get("industry_level") # 行业等级,(父行个为"1",子行业为"2") industry_level = req_dict.get("industry_level") # 行业等级,(父行个为"1",子行业为"2")
product = req_dict.get("product")
page = req_dict.get("page") # 分页页码 page = req_dict.get("page") # 分页页码
perpage = req_dict.get("perpage") # 分页大小 perpage = req_dict.get("perpage") # 分页大小
# sorts = req_dict.get("sorts") # 排序 sorts "1"按时间降序 ,“2”按热度降序 # sorts = req_dict.get("sorts") # 排序 sorts "1"按时间降序 ,“2”按热度降序
# 校验参数完整性 # 校验参数完整性
if not all([inid, industry_level, page, perpage]): if not all([industry_level, page, perpage]):
return jsonify(code=RET.PARAMERR, msg="参数不完整") return jsonify(code=RET.PARAMERR, msg="参数不完整")
try: try:
...@@ -154,10 +155,11 @@ def industry_enterprise(): ...@@ -154,10 +155,11 @@ def industry_enterprise():
company = Company.query.filter_by(f_type=inid, city="晋城市") company = Company.query.filter_by(f_type=inid, city="晋城市")
else: else:
company = Company.query.filter_by(c_type=inid, city="晋城市") company = Company.query.filter_by(c_type=inid, city="晋城市")
if product:
company = Company.query.filter(Company.product_all.like("%{}%".format(product)))
size = company.count() size = company.count()
# if sorts == 1:
# companys = company.order_by(Company.build_date.desc()).paginate(page, perpage).items # 企业热度倒序
# else:
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,
......
...@@ -2,8 +2,9 @@ from py2neo import Graph ...@@ -2,8 +2,9 @@ from py2neo import Graph
def conn_neo4j(): def conn_neo4j():
# graph = Graph("http://localhost:7474", username="neo4j", password="123456") # graph = Graph("http://localhost:7474", username="neo4j", password="123456") # 本地neo4j
graph = Graph("http://localhost:7476", username="neo4j", password="123456") graph = Graph("http://localhost:7476", username="neo4j", password="123456") # 上传到50服务器前需更改
# graph = Graph("http://39.100.39.50:7476/", username="neo4j", password="123456") # 测试50服务器上的neo4j时使用
return graph return graph
......
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