Commit 600e4541 by 赵宇

fix

parent 471bb567
...@@ -691,6 +691,7 @@ class Induzone(db.Model): ...@@ -691,6 +691,7 @@ class Induzone(db.Model):
mall_point = db.Column(db.Float, doc='购物中心的评分', comment='购物中心的评分') # 购物中心的评分 mall_point = db.Column(db.Float, doc='购物中心的评分', comment='购物中心的评分') # 购物中心的评分
hotel_point = db.Column(db.Float, doc='酒店餐饮的评分', comment='酒店餐饮的评分') # 酒店餐饮的评分 hotel_point = db.Column(db.Float, doc='酒店餐饮的评分', comment='酒店餐饮的评分') # 酒店餐饮的评分
development_zone = db.Column(db.String(255), doc='所在开发区', comment='所在开发区') # 所在开发区 development_zone = db.Column(db.String(255), doc='所在开发区', comment='所在开发区') # 所在开发区
upper_district = db.Column(db.String(255), doc='上级行政区', comment='上级行政区') # 所在开发区
# 项目列表 # 项目列表
# class Item(db.Model): # class Item(db.Model):
......
...@@ -14,14 +14,18 @@ def default_address(): ...@@ -14,14 +14,18 @@ def default_address():
perpage = req_dict.get("perpage") perpage = req_dict.get("perpage")
# 查询出该区县的所有园区列表 # 查询出该区县的所有园区列表
try: try:
if district=="晋城市":
result = Induzone.query.filter_by(upper_district=district).all()
all_jwd = [{"id": i.id, "name": i.name, "lng": i.lng, "lat": i.lat} for i in result]
size = len(result)
result = Induzone.query.filter_by(upper_district=district)
result = result.paginate(page, perpage).items
else:
result = Induzone.query.filter_by(district=district).all() result = Induzone.query.filter_by(district=district).all()
all_jwd = [{"id": i.id, "name": i.name, "lng": i.lng, "lat": i.lat} for i in result] all_jwd = [{"id": i.id, "name": i.name, "lng": i.lng, "lat": i.lat} for i in result]
size = len(result) size = len(result)
result = Induzone.query.filter_by(district=district) result = Induzone.query.filter_by(district=district)
result = result.paginate(page, perpage).items result = result.paginate(page, perpage).items
print(result)
print(result)
if not result: if not result:
# 在第一条建议显示 # 在第一条建议显示
data = [{"name": "没有找到合适的园区!"}] data = [{"name": "没有找到合适的园区!"}]
...@@ -71,7 +75,6 @@ def advice(): ...@@ -71,7 +75,6 @@ def advice():
# 根据产业名称查询园区 # 根据产业名称查询园区
zone = Induzone.query.filter(or_(Induzone.navigat.like("%{}%".format(industry_name)), zone = Induzone.query.filter(or_(Induzone.navigat.like("%{}%".format(industry_name)),
Induzone.navigator.like("%{}%".format(industry_name)))) Induzone.navigator.like("%{}%".format(industry_name))))
print(type(zone))
# 根据投资预算过滤 # 根据投资预算过滤
if budget: if budget:
zone = zone.filter(Induzone.invest_power < budget) zone = zone.filter(Induzone.invest_power < budget)
...@@ -92,11 +95,8 @@ def advice(): ...@@ -92,11 +95,8 @@ def advice():
if preference[4] == "true": # 交通 -----交通打分 if preference[4] == "true": # 交通 -----交通打分
zone = zone.order_by(Induzone.traffic_point.desc()) zone = zone.order_by(Induzone.traffic_point.desc())
size = zone.count() size = zone.count()
print(type(zone))
result = zone.paginate(page, perpage).items result = zone.paginate(page, perpage).items
print(type(zone)) zone = zone.all
zone = zone.all()
all_jwd = [{"id": i.id, "name": i.name, "lng": i.lng, "lat": i.lat} for i in zone] all_jwd = [{"id": i.id, "name": i.name, "lng": i.lng, "lat": i.lat} for i in zone]
data = {"data": [{"id": i.id, data = {"data": [{"id": i.id,
"name": i.name, # 园区名称 "name": i.name, # 园区名称
......
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