修复一些问题

main
roger_home_pc 2 years ago
parent b0199e676a
commit 4058b24f1a
  1. 3
      orm/db.py
  2. 8
      orm/real_index.py
  3. 2
      orm/red_forecast.py

@ -169,7 +169,8 @@ def db_index_get_last_date_id(_type):
index_result = db_session.execute(index_stmt).scalars()
date_id_list = []
for row in index_result:
date_id_list.append(row.date_id)
print(row)
date_id_list.append(row)
return date_id_list

@ -65,9 +65,8 @@ def update_real_data():
}
db_red_update(_id, red_date_id, update_data)
# 插入 IndexGroup index_group
insert_index_group(
{'dateId': red_date_id, 'type': 'history', 'index_group': json.dumps(history_index_group)})
insert_index_group({'dateId': red_date_id, 'type': 'last', 'index_group': json.dumps(last_index_group)})
insert_index_group(red_date_id, 'history', json.dumps(history_index_group))
insert_index_group(red_date_id, 'last', json.dumps(last_index_group))
if blue_date_id['five'] == old_history_date_id:
# 插入 real_blue, prv_index, post_index, history_index
@ -102,8 +101,9 @@ def update_real_data():
}
db_blue_update(blue_date_id['three'], update_data, _id, 3)
# 插入预测数据
def general_forecast_data():
forecast_blue()
red_forecast()

@ -58,7 +58,7 @@ def get_last_red_delta(_last_red):
def get_index_from_db(_index_type):
index_list = db_index_get_index_group(_index_type)
if len(index_list) > 0:
if len(index_list) > 20:
return random.choice(index_list)
else:
return get_random_index_group()

Loading…
Cancel
Save