update pay ui
This commit is contained in:
19
app.py
19
app.py
@@ -12538,9 +12538,10 @@ def get_hotspot_overview():
|
||||
|
||||
# 2. 获取概念异动数据(从 concept_anomaly_hybrid 表)
|
||||
alerts = []
|
||||
with engine.connect() as conn:
|
||||
# 首先确保表存在
|
||||
try:
|
||||
|
||||
# 首先确保表存在(使用 begin() 来自动提交)
|
||||
try:
|
||||
with engine.begin() as conn:
|
||||
conn.execute(text("""
|
||||
CREATE TABLE IF NOT EXISTS concept_anomaly_hybrid (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
@@ -12569,10 +12570,10 @@ def get_hotspot_overview():
|
||||
INDEX idx_alert_type (alert_type)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='概念异动检测结果(融合版)'
|
||||
"""))
|
||||
conn.commit()
|
||||
except Exception as create_err:
|
||||
logger.debug(f"创建表检查: {create_err}")
|
||||
except Exception as create_err:
|
||||
logger.debug(f"创建表检查: {create_err}")
|
||||
|
||||
with engine.connect() as conn:
|
||||
# 查询 concept_anomaly_hybrid 表
|
||||
alert_result = conn.execute(text("""
|
||||
SELECT
|
||||
@@ -12699,10 +12700,12 @@ def get_hotspot_overview():
|
||||
|
||||
except Exception as e:
|
||||
import traceback
|
||||
logger.error(f"获取热点概览数据失败: {traceback.format_exc()}")
|
||||
error_trace = traceback.format_exc()
|
||||
logger.error(f"获取热点概览数据失败: {error_trace}")
|
||||
return jsonify({
|
||||
'success': False,
|
||||
'error': str(e)
|
||||
'error': str(e),
|
||||
'traceback': error_trace # 临时返回完整错误信息用于调试
|
||||
}), 500
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user