This commit is contained in:
lwl0608 2024-12-09 17:14:42 +08:00
parent 2848425315
commit 7098dd4120
1 changed files with 11 additions and 11 deletions

View File

@ -1994,6 +1994,16 @@ func (v *Vas) WithdrawApply(ctx *gin.Context, req *vasproto.WithdrawApplyReq) (t
return
}
// 获取能提现的支付宝
alipayAcnt, err := v.store.GetAvailableWithdrawAlipayAccount(ctx, money)
if err != nil {
logger.Error("GetAvailableWithdrawAlipayAccount fail, err: %v", err)
err = fmt.Errorf("提现维护中,请稍后再试")
return
}
alipayCli := alipaycli.GetAlipayClientByAppId(alipayAcnt.AppId)
logger.Info("Get AlipayAcnt ok, aliAcnt: %v, req: %v", util.ToJson(alipayCli), util.ToJson(req))
// 添加提现订单
wOrder = &dbstruct.WithdrawOrder{
ID: goproto.String(orderId),
@ -2006,7 +2016,7 @@ func (v *Vas) WithdrawApply(ctx *gin.Context, req *vasproto.WithdrawApplyReq) (t
WithdrawMoney: goproto.Int64(money),
Ip: goproto.String(req.Ip),
OrderStatus: goproto.Int32(dbstruct.VasWithdrawOrderStatusInit),
Operator: goproto.String(""),
Operator: goproto.String(alipayCli.AppId),
OpTime: goproto.Int64(0),
}
err = v.store.CreateWithdrawOrder(ctx, tx, wOrder)
@ -2015,16 +2025,6 @@ func (v *Vas) WithdrawApply(ctx *gin.Context, req *vasproto.WithdrawApplyReq) (t
return
}
// 获取能提现的支付宝
alipayAcnt, err := v.store.GetAvailableWithdrawAlipayAccount(ctx, money)
if err != nil {
logger.Error("GetAvailableWithdrawAlipayAccount fail, err: %v", err)
err = fmt.Errorf("提现维护中,请稍后再试")
return
}
alipayCli := alipaycli.GetAlipayClientByAppId(alipayAcnt.AppId)
logger.Info("Get AlipayAcnt ok, aliAcnt: %v, req: %v", util.ToJson(alipayCli), util.ToJson(req))
// 更改状态
err = v.store.UpdateWithdrawOrderStatus(ctx, tx, orderId, dbstruct.VasWithdrawOrderStatusInit, dbstruct.VasWithdrawOrderStatusAuto)
if err != nil {