From 7098dd4120810b819aada791b40e42c736736293 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Mon, 9 Dec 2024 17:14:42 +0800 Subject: [PATCH] fix --- app/mix/service/logic/vas.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/mix/service/logic/vas.go b/app/mix/service/logic/vas.go index fa7d9509..8ec4e923 100644 --- a/app/mix/service/logic/vas.go +++ b/app/mix/service/logic/vas.go @@ -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 {