From 0f0133d8e33055d0fc688c02acb04bf153d07e34 Mon Sep 17 00:00:00 2001 From: mofangmin Date: Mon, 15 Jul 2024 11:19:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pay/timer.go | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/modules/pay/timer.go b/modules/pay/timer.go index 14b8bb7..9a6a0bc 100644 --- a/modules/pay/timer.go +++ b/modules/pay/timer.go @@ -206,7 +206,7 @@ func getSuccessPerTotal(channel int) int64 { } func WithdrawTimer() { - list := []*common.WithdrawOrder{} + var list []*common.WithdrawOrder // startData := time.Now().AddDate(0, 0, -1).Unix() db.Mysql().QueryAll(fmt.Sprintf("status = %d and pay_source = %d", common.StatusROrderWaitting, common.PaySourceModulePay), "", &common.WithdrawOrder{}, &list) @@ -257,17 +257,20 @@ func TryWithdraw(or *common.WithdrawOrder) { return } req := &pb.InnerWithdrawReq{ - OrderID: or.OrderID, - Amount: or.Amount, - Phone: send.Mobile, - Name: send.Name, - Email: send.Email, - PayType: int64(send.PayType), - // Number: send.Number, - UID: uint32(or.UID), - Channel: int64(or.UPI), - // Address: send.Address, - IP: send.IP, + OrderID: or.OrderID, + Amount: or.Amount, + Phone: send.Mobile, + Name: send.AccountName, + CardNo: send.BankCardNo, + PayCode: send.BankCode, + PayType: int64(send.PayType), + UID: uint32(or.UID), + Channel: int64(or.UPI), + Email: send.Email, + BankName: send.BankName, + BankBranchName: send.BankBranchName, + DeviceID: send.DeviceNo, + IP: send.IP, } channel := call.GetConfigWithdrawChannelsByID(int(req.Channel), common.CurrencyINR) if channel == nil || channel.WithdrawPer <= 0 { @@ -296,7 +299,9 @@ func TryWithdraw(or *common.WithdrawOrder) { data := &pb.InnerWithdrawResp{} proto.Unmarshal(ret, data) log.Debug("withdraw resp:%+v", *data) + u := map[string]interface{}{"pay_channel": req.Channel} if data.APIOrderID != "" { - db.Mysql().Update(&common.WithdrawOrder{ID: or.ID}, map[string]interface{}{"apipayid": data.APIOrderID}) + u["apipayid"] = data.APIOrderID } + db.Mysql().Update(&common.WithdrawOrder{ID: or.ID}, u) } -- 2.36.2 From f708a813727161a0a8fff57f367351aeed43a197 Mon Sep 17 00:00:00 2001 From: mofangmin Date: Tue, 16 Jul 2024 10:07:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/web/handler/withdraw.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/web/handler/withdraw.go b/modules/web/handler/withdraw.go index 275ebad..c0693b1 100644 --- a/modules/web/handler/withdraw.go +++ b/modules/web/handler/withdraw.go @@ -350,15 +350,15 @@ func PlayerWithdraw(c *gin.Context) { con := call.GetVipCon(uid) realAmount := need // 实际打款 if con != nil && con.Fee > 0 { - realAmount = common.RoundCurrency(req.CurrencyType, (1000-int64(con.Fee))*realAmount/1000) + realAmount = common.RoundCurrency(req.CurrencyType, (1000-int64(con.Fee))*realAmount/1000) - 6 // 固定税费 } var shouldAuto = false // 在总赠送比配置比例小时才判断个人 - if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { - // 直接发起退出 - shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) - } + // if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { + // // 直接发起退出 + // shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) + // } // 第二步,创建订单 withdrawChannel := -1 if req.ChannelID != nil { -- 2.36.2