Fix databi backfill active day formatting

This commit is contained in:
zhx 2026-06-08 12:29:17 +08:00
parent b49a2109c7
commit 40fa44eaa5

View File

@ -356,7 +356,7 @@ func rebuildRegistrations(ctx context.Context, db *sql.DB, state *rebuildState,
func rebuildActive(ctx context.Context, db *sql.DB, state *rebuildState, app, startDay, endDay string) error {
// 活跃的原始房间事件已经被实时消费进 stat_user_day_activity离线回填只重刷该表的国家/区域快照,避免在大窗口内扫描房间流水。
rows, err := db.QueryContext(ctx, `
SELECT stat_day, user_id, MIN(first_active_at_ms)
SELECT DATE_FORMAT(stat_day, '%Y-%m-%d'), user_id, MIN(first_active_at_ms)
FROM stat_user_day_activity
WHERE app_code = ? AND stat_day BETWEEN ? AND ?
GROUP BY stat_day, user_id`,