f
This commit is contained in:
@@ -53,9 +53,11 @@ func (l *AdminAuditWithdrawalLogic) AdminAuditWithdrawal(req *types.AdminAuditWi
|
||||
|
||||
// 4. 使用事务处理审核
|
||||
err = l.svcCtx.AgentWithdrawalModel.Trans(l.ctx, func(transCtx context.Context, session sqlx.Session) error {
|
||||
if req.Status == 2 { // 审核通过
|
||||
switch req.Status {
|
||||
case 2: // 审核通过
|
||||
// 4.1 根据提现方式处理
|
||||
if withdrawal.WithdrawalType == 1 {
|
||||
switch withdrawal.WithdrawalType {
|
||||
case 1:
|
||||
// 支付宝提现:审核通过前再次校验月度额度,避免一次性通过多笔超限
|
||||
now := time.Now()
|
||||
monthStart := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location())
|
||||
@@ -166,7 +168,8 @@ func (l *AdminAuditWithdrawalLogic) AdminAuditWithdrawal(req *types.AdminAuditWi
|
||||
return errors.Wrapf(err, "更新提现记录失败")
|
||||
}
|
||||
}
|
||||
} else if withdrawal.WithdrawalType == 2 {
|
||||
|
||||
case 2:
|
||||
// 银行卡提现:审核通过即视为提现成功(线下已/将立即打款)
|
||||
withdrawal.Status = 5 // 提现成功
|
||||
withdrawal.Remark = sql.NullString{String: req.Remark, Valid: true}
|
||||
@@ -197,7 +200,7 @@ func (l *AdminAuditWithdrawalLogic) AdminAuditWithdrawal(req *types.AdminAuditWi
|
||||
}
|
||||
}
|
||||
|
||||
} else if req.Status == 3 { // 审核拒绝
|
||||
case 3: // 审核拒绝
|
||||
// 4.1 更新提现记录状态为拒绝
|
||||
withdrawal.Status = 3 // 审核拒绝
|
||||
withdrawal.Remark = sql.NullString{String: req.Remark, Valid: true}
|
||||
|
||||
Reference in New Issue
Block a user