修复押金与待解冻资金处理

This commit is contained in:
yml2213
2026-08-28 22:22:26 +08:00
parent f20ff3018f
commit 04dc363320
16 changed files with 97 additions and 23 deletions
@@ -0,0 +1,9 @@
-- 066_worker_unfreeze_fund_type.sql —— 区分待解冻押金与待解冻报酬,防止后台扣押金误扣报酬。
ALTER TABLE worker_deposit_unfreezes
ADD COLUMN IF NOT EXISTS fund_type TEXT NOT NULL DEFAULT 'legacy_combined';
CREATE INDEX IF NOT EXISTS idx_worker_deposit_unfreezes_order_fund_status
ON worker_deposit_unfreezes(work_order_id, fund_type, status);
COMMENT ON COLUMN worker_deposit_unfreezes.fund_type IS '待解冻资金类型:deposit 押金 / reward 报酬 / legacy_combined 历史合并记录';