fix: 卡日流量查询改用卡日快照 tb_card_flow_day
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 12m2s

tb_card_daily_usage 为已停用旧表(测试库为空,且列名与模型不一致),
卡日流量列表与索引改用采集链路写入的 tb_card_flow_day,当日用量取 settled_mb。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-11-05 18:59:30 +09:00
parent 94cbf2adab
commit 7e0e37933e
7 changed files with 26 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
DROP INDEX IF EXISTS idx_package_usage_adjustment_time;
DROP INDEX IF EXISTS idx_package_usage_daily_record_day;
DROP INDEX IF EXISTS idx_card_daily_usage_date_usage;
DROP INDEX IF EXISTS idx_card_flow_day_date_settled;
DROP INDEX IF EXISTS idx_card_stop_resume_record_command;
DROP INDEX IF EXISTS idx_card_stop_resume_record_scene;
DROP INDEX IF EXISTS idx_card_stop_resume_record_time;

View File

@@ -6,7 +6,8 @@ CREATE INDEX IF NOT EXISTS idx_card_stop_resume_record_time ON tb_card_stop_resu
CREATE INDEX IF NOT EXISTS idx_card_stop_resume_record_scene ON tb_card_stop_resume_record (scene, created_at DESC);
CREATE INDEX IF NOT EXISTS idx_card_stop_resume_record_command ON tb_card_stop_resume_record (command_id);
CREATE INDEX IF NOT EXISTS idx_card_daily_usage_date_usage ON tb_card_daily_usage (date, usage_mb DESC);
-- 卡日流量取采集链路写入的卡日快照 tb_card_flow_day(tb_card_daily_usage 为已停用旧表)。
CREATE INDEX IF NOT EXISTS idx_card_flow_day_date_settled ON tb_card_flow_day (flow_date, settled_mb DESC);
CREATE INDEX IF NOT EXISTS idx_package_usage_daily_record_day ON tb_package_usage_daily_record (date);