优化号主交接超时卡死问题

- 号主交接超时(owner_timeout)后允许补提交交接说明,避免临时延误导致订单卡死
- 后台新增"重置交接"动作,可将超时订单恢复为待号主交接并刷新计时
- 交接超时改以进入待交接时刻为基准计算,新增 handoff_started_at 字段

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
yml2213
2026-06-17 04:16:31 +08:00
co-authored by Claude Opus 4.8
parent ae11dd7b8d
commit 8192344027
13 changed files with 140 additions and 23 deletions
@@ -0,0 +1,15 @@
-- +goose Up
-- 新增进入“待号主交接”的时间,用于精确计算号主交接超时(以支付完成时刻为基准,而非订单创建时刻)。
ALTER TABLE rental_orders
ADD COLUMN handoff_started_at DATETIME NULL COMMENT '进入待号主交接的时间,用于计算交接超时' AFTER rented_at;
-- 历史数据兜底:已进入交接及之后阶段的订单,用 created_at 回填,避免基准缺失。
UPDATE rental_orders
SET handoff_started_at = created_at
WHERE handoff_started_at IS NULL
AND status NOT IN ('pending_payment', 'cancelled');
-- +goose Down
ALTER TABLE rental_orders DROP COLUMN handoff_started_at;