事件中心的涨停原因里面和事件相关

This commit is contained in:
2026-01-12 07:14:30 +08:00
parent 11c9e7b134
commit ab5573ff36
4 changed files with 902 additions and 781 deletions

View File

@@ -189,7 +189,7 @@ def init_prediction_api(db, beijing_now):
def get_prediction_topics():
"""获取预测话题列表"""
try:
status = request.args.get('status', 'active')
status = request.args.get('status', '') # 默认为空,表示全部状态
category = request.args.get('category')
sort_by = request.args.get('sort_by', 'created_at')
page = request.args.get('page', 1, type=int)
@@ -198,7 +198,8 @@ def init_prediction_api(db, beijing_now):
# 构建查询
query = PredictionTopic.query
if status:
# status 为空、'all' 或 'all_status' 时不过滤,返回全部
if status and status not in ('all', 'all_status', ''):
query = query.filter_by(status=status)
if category:
query = query.filter_by(category=category)