feat: implement withdrawal improvements P01-P05

- P04: fix Withdrawal.TableName() to return 'withdrawals'
- P03: add WithdrawalStatus* and WithdrawalMethod* constants; replace magic numbers; add CommissionTypeWithdrawCancel=338
- P01: add POST /v1/public/user/withdrawal_cancel to cancel pending withdrawals with ownership check, row lock, commission refund, and audit log
- P02: add method/account/qr_code_url fields to Withdrawal model and API; add input validation (qr_code_url required for Alipay/Wechat, account required for bank)
- P05: add method filter to admin GET /v1/admin/user/withdrawal/list

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-05-25 20:44:04 -07:00
parent a6e9e2bdb8
commit 8b75be6e14
16 changed files with 219 additions and 17 deletions
@@ -0,0 +1,4 @@
ALTER TABLE `withdrawals`
DROP COLUMN `qr_code_url`,
DROP COLUMN `account`,
DROP COLUMN `method`;
@@ -0,0 +1,4 @@
ALTER TABLE `withdrawals`
ADD COLUMN `method` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '收款方式 0:其他 1:支付宝 2:微信 3:银行卡' AFTER `content`,
ADD COLUMN `account` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '收款账号' AFTER `method`,
ADD COLUMN `qr_code_url` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '收款码图片URL' AFTER `account`;