修复提现

pull/7/head
mofangmin 1 year ago
parent 4ea3ae4bc6
commit 0f0133d8e3
  1. 31
      modules/pay/timer.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)
@ -257,17 +257,20 @@ func TryWithdraw(or *common.WithdrawOrder) {
return return
} }
req := &pb.InnerWithdrawReq{ req := &pb.InnerWithdrawReq{
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,
PayType: int64(send.PayType), PayCode: send.BankCode,
// Number: send.Number, PayType: int64(send.PayType),
UID: uint32(or.UID), UID: uint32(or.UID),
Channel: int64(or.UPI), Channel: int64(or.UPI),
// Address: send.Address, Email: send.Email,
IP: send.IP, BankName: send.BankName,
BankBranchName: send.BankBranchName,
DeviceID: send.DeviceNo,
IP: send.IP,
} }
channel := call.GetConfigWithdrawChannelsByID(int(req.Channel), common.CurrencyINR) channel := call.GetConfigWithdrawChannelsByID(int(req.Channel), common.CurrencyINR)
if channel == nil || channel.WithdrawPer <= 0 { if channel == nil || channel.WithdrawPer <= 0 {
@ -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)
} }

Loading…
Cancel
Save