pull/9/head
mofangmin 1 year ago
commit 2a8b0481f0
  1. 17
      modules/pay/timer.go
  2. 10
      modules/web/handler/withdraw.go

@ -206,7 +206,7 @@ func getSuccessPerTotal(channel int) int64 {
} }
func WithdrawTimer() { func WithdrawTimer() {
list := []*common.WithdrawOrder{} var list []*common.WithdrawOrder
// startData := time.Now().AddDate(0, 0, -1).Unix() // startData := time.Now().AddDate(0, 0, -1).Unix()
db.Mysql().QueryAll(fmt.Sprintf("status = %d and pay_source = %d", db.Mysql().QueryAll(fmt.Sprintf("status = %d and pay_source = %d",
common.StatusROrderWaitting, common.PaySourceModulePay), "", &common.WithdrawOrder{}, &list) common.StatusROrderWaitting, common.PaySourceModulePay), "", &common.WithdrawOrder{}, &list)
@ -260,13 +260,16 @@ func TryWithdraw(or *common.WithdrawOrder) {
OrderID: or.OrderID, OrderID: or.OrderID,
Amount: or.Amount, Amount: or.Amount,
Phone: send.Mobile, Phone: send.Mobile,
Name: send.Name, Name: send.AccountName,
Email: send.Email, CardNo: send.BankCardNo,
PayCode: send.BankCode,
PayType: int64(send.PayType), PayType: int64(send.PayType),
// Number: send.Number,
UID: uint32(or.UID), UID: uint32(or.UID),
Channel: int64(or.UPI), Channel: int64(or.UPI),
// Address: send.Address, Email: send.Email,
BankName: send.BankName,
BankBranchName: send.BankBranchName,
DeviceID: send.DeviceNo,
IP: send.IP, IP: send.IP,
} }
channel := call.GetConfigWithdrawChannelsByID(int(req.Channel), common.CurrencyINR) channel := call.GetConfigWithdrawChannelsByID(int(req.Channel), common.CurrencyINR)
@ -296,7 +299,9 @@ func TryWithdraw(or *common.WithdrawOrder) {
data := &pb.InnerWithdrawResp{} data := &pb.InnerWithdrawResp{}
proto.Unmarshal(ret, data) proto.Unmarshal(ret, data)
log.Debug("withdraw resp:%+v", *data) log.Debug("withdraw resp:%+v", *data)
u := map[string]interface{}{"pay_channel": req.Channel}
if data.APIOrderID != "" { 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)
} }

@ -350,15 +350,15 @@ func PlayerWithdraw(c *gin.Context) {
con := call.GetVipCon(uid) con := call.GetVipCon(uid)
realAmount := need // 实际打款 realAmount := need // 实际打款
if con != nil && con.Fee > 0 { 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 var shouldAuto = false
// 在总赠送比配置比例小时才判断个人 // 在总赠送比配置比例小时才判断个人
if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer { // if call.GetTotalRechargePer(realAmount) < config.GetConfig().Web.TotalWithdrawPer {
// 直接发起退出 // // 直接发起退出
shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount) // shouldAuto = call.CanAutoWithdraw(uid, re.TotalRecharge, re.TotalWithdraw+re.TotalWithdrawing+realAmount)
} // }
// 第二步,创建订单 // 第二步,创建订单
withdrawChannel := -1 withdrawChannel := -1
if req.ChannelID != nil { if req.ChannelID != nil {

Loading…
Cancel
Save