Commit 1f91445f by dong

fix20230111

parent 5cf6e3a4
......@@ -83,7 +83,8 @@ def search_project1():
ProjectManagement.development_area == development_area if development_area else text(''),
ProjectManagement.investment_volume > investment_volume[0] if investment_volume else text(''),
ProjectManagement.investment_volume <= investment_volume[1] if investment_volume else text(''),
ProjectManagement.investor_district.like('%{}%'.format(investor_district)) if investor_district else text(''),
ProjectManagement.investor_district.like('%{}%'.format(investor_district)) if investor_district else text(
''),
ProjectManagement.industry.like('%{}%'.format(industry1)) if industry1 else text(''),
ProjectManagement.industry2.like('%{}%'.format(industry2)) if industry2 else text(''),
ProjectManagement.investor_name.like('%{}%'.format(investor_name)) if investor_name else text(''),
......
......@@ -396,18 +396,19 @@ def get_data_li(district_li, current_year):
def statistic_shanxi_data():
req_dic = request.get_json()
flag = req_dic['flag'] # 1项目签约金额完成情况, 2新开工项目计划投资额完成情况, 3固定资产投资项目资金到位完成情况
data_time = req_dic['data_time'] # ["2022", "07", "18"]
data_time = data_time[0] + '年' + data_time[1] + '-' + data_time[2] + '月'
# data_time = req_dic['data_time'] # ["2022", "07", "18"]
# data_time = data_time[0] + '年' + data_time[1] + '-' + data_time[2] + '月'
try:
# 获取最新的时间周期
data_obj = ShanxiTarget.query.order_by(sqlalchemy.desc(ShanxiTarget.id)).first()
data_time1 = data_obj.data_time
if not data_time1:
# 获取最新时间周期的数据
target_obj_li = ShanxiTarget.query.filter_by(data_time=data_time1, is_delete=0).all()
else:
# 获取所选时间周期条件的数据
target_obj_li = ShanxiTarget.query.filter_by(data_time=data_time, is_delete=0).all()
data_time = data_obj.data_time
# if not data_time1:
# # 获取最新时间周期的数据
# target_obj_li = ShanxiTarget.query.filter_by(data_time=data_time1, is_delete=0).all()
# else:
# # 获取所选时间周期条件的数据
# target_obj_li = ShanxiTarget.query.filter_by(data_time=data_time, is_delete=0).all()
target_obj_li = ShanxiTarget.query.filter_by(data_time=data_time, is_delete=0).all()
data1 = ''
data2 = ''
......
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