Commit 33991e37 by 赵宇

fix

parent b0929bfc
......@@ -57,7 +57,8 @@ def menu():
'陵川县': '陵川县',
'阳城县': '阳城县',
'泽州县': '泽州县',
'城区': '城区'
'城区': '城区',
'晋城经济技术开发区': '晋城经济技术开发区'
}
if not district or district == '晋城市':
......@@ -101,7 +102,7 @@ def menu():
# 2. 左上角获取经济指标数据
jjzb_data = get_jjzb(district)
# 3. 产业构分布饼状图数据统计
# 3. 产业构分布饼状图数据统计
count_all = company.count()
if count_all == 0:
count_all = 1
......@@ -154,7 +155,7 @@ def project():
project_map = []
industry_money = []
industry_nums = []
list1 = ["晋城市", "沁水县", "高平市", "陵川县", "阳城县", "泽州县", "城区"]
list1 = ["晋城市", "沁水县", "高平市", "陵川县", "阳城县", "泽州县", "城区","晋城经济技术开发区"]
# 晋城市,点击区县之前默认数据
if not district or district == '晋城市':
......@@ -361,9 +362,14 @@ def policy_details():
_id2 = int(_id) - 1
if _id2 < 1:
_id2 = ''
policy_len = InduPolicy.query.count()
if _id1 > policy_len:
_id1 = ''
policy = InduPolicy.query.get(_id)
policy1 = InduPolicy.query.get(str(_id1))
policy2 = InduPolicy.query.get(str(_id2))
if policy:
data = {"name": policy.name, # 政策名
"file": policy.file if policy.file else "-", # 本地文件位置
"category": policy.category if policy.category else "-", # 政策类型
......@@ -376,6 +382,8 @@ def policy_details():
"last": [policy2.name, _id1] if policy2 else "",
"next": [policy1.name, _id2] if policy1 else ""}
return jsonify(code=RET.OK, msg="查找成功", data=data)
else:
pass
except Exception as e:
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="数据库错误")
......@@ -388,6 +396,7 @@ def showListb():
type = req_dic.get("type") # 12345678 (500强-上市-规模-专精特新-高新-科技中小-瞪羚-独角兽)
district = req_dic.get("district")
page = req_dic.get("page")
per_page = req_dic.get("per_page")
if not all([type, district]):
return jsonify(code=RET.PARAMERR, msg="参数错误")
......@@ -428,7 +437,7 @@ def showListb():
if type == 8:
company = company.filter_by(unicorn=1)
size = company.count()
company = company.paginate(page, per_page=4).items
company = company.paginate(page, per_page=int(per_page)).items
data = [{
"id": i.id,
"name": i.company_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