f
This commit is contained in:
@@ -53,9 +53,11 @@ func (l *AdminAuditWithdrawalLogic) AdminAuditWithdrawal(req *types.AdminAuditWi
|
|||||||
|
|
||||||
// 4. 使用事务处理审核
|
// 4. 使用事务处理审核
|
||||||
err = l.svcCtx.AgentWithdrawalModel.Trans(l.ctx, func(transCtx context.Context, session sqlx.Session) error {
|
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 根据提现方式处理
|
// 4.1 根据提现方式处理
|
||||||
if withdrawal.WithdrawalType == 1 {
|
switch withdrawal.WithdrawalType {
|
||||||
|
case 1:
|
||||||
// 支付宝提现:审核通过前再次校验月度额度,避免一次性通过多笔超限
|
// 支付宝提现:审核通过前再次校验月度额度,避免一次性通过多笔超限
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
monthStart := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location())
|
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, "更新提现记录失败")
|
return errors.Wrapf(err, "更新提现记录失败")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if withdrawal.WithdrawalType == 2 {
|
|
||||||
|
case 2:
|
||||||
// 银行卡提现:审核通过即视为提现成功(线下已/将立即打款)
|
// 银行卡提现:审核通过即视为提现成功(线下已/将立即打款)
|
||||||
withdrawal.Status = 5 // 提现成功
|
withdrawal.Status = 5 // 提现成功
|
||||||
withdrawal.Remark = sql.NullString{String: req.Remark, Valid: true}
|
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 更新提现记录状态为拒绝
|
// 4.1 更新提现记录状态为拒绝
|
||||||
withdrawal.Status = 3 // 审核拒绝
|
withdrawal.Status = 3 // 审核拒绝
|
||||||
withdrawal.Remark = sql.NullString{String: req.Remark, Valid: true}
|
withdrawal.Remark = sql.NullString{String: req.Remark, Valid: true}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import (
|
|||||||
"ycc-server/pkg/lzkit/lzUtils"
|
"ycc-server/pkg/lzkit/lzUtils"
|
||||||
|
|
||||||
"github.com/smartwalle/alipay/v3"
|
"github.com/smartwalle/alipay/v3"
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AliPayService struct {
|
type AliPayService struct {
|
||||||
@@ -232,10 +233,10 @@ func (a *AliPayService) AliTransfer(
|
|||||||
|
|
||||||
// 执行转账请求
|
// 执行转账请求
|
||||||
transferRsp, err := a.AlipayClient.FundTransUniTransfer(ctx, req)
|
transferRsp, err := a.AlipayClient.FundTransUniTransfer(ctx, req)
|
||||||
|
logx.Infof("支付宝转账请求,响应数据: %+v", transferRsp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("支付宝转账请求失败: %v", err)
|
return nil, fmt.Errorf("支付宝转账请求失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return transferRsp, nil
|
return transferRsp, nil
|
||||||
}
|
}
|
||||||
func (a *AliPayService) QueryTransferStatus(
|
func (a *AliPayService) QueryTransferStatus(
|
||||||
|
|||||||
Reference in New Issue
Block a user