|
|
|
|
@ -396,11 +396,17 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa |
|
|
|
|
order := &common.WithdrawOrder{} |
|
|
|
|
order.ID = or.ID |
|
|
|
|
tx := db.Mysql().Begin() |
|
|
|
|
// 打款失败的单,重新挂起到后台进入人工审核,不再返还金币给玩家
|
|
|
|
|
u := map[string]interface{}{ |
|
|
|
|
"status": status, |
|
|
|
|
"fail_reason": or.FailReason, |
|
|
|
|
"callback_time": time.Now().Unix(), |
|
|
|
|
} |
|
|
|
|
if len(or.Operator) == 0 { |
|
|
|
|
status = common.StatusROrderCreate |
|
|
|
|
delete(u, "callback_time") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if len(payChannel) > 0 { |
|
|
|
|
u["pay_channel"] = payChannel[0] |
|
|
|
|
} |
|
|
|
|
@ -423,11 +429,14 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa |
|
|
|
|
uid := or.UID |
|
|
|
|
re := new(common.RechargeInfo) |
|
|
|
|
re.UID = uid |
|
|
|
|
updateRe := map[string]interface{}{ |
|
|
|
|
updateRe := map[string]interface{}{} |
|
|
|
|
if status != common.StatusROrderCreate { |
|
|
|
|
updateRe = map[string]interface{}{ |
|
|
|
|
"withdrawing_cash": gorm.Expr("withdrawing_cash - ?", or.WithdrawCash), |
|
|
|
|
"total_withdrawing": gorm.Expr("total_withdrawing - ?", or.Amount), |
|
|
|
|
"day_withdraw": gorm.Expr("day_withdraw - ?", or.Amount), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if status == common.StatusROrderFail || status == common.StatusROrderRefuse { |
|
|
|
|
updateRe["withdraw_count"] = gorm.Expr("withdraw_count + ?", -1) |
|
|
|
|
} |
|
|
|
|
@ -438,6 +447,7 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa |
|
|
|
|
tx.Rollback() |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
if status != common.StatusROrderCreate { |
|
|
|
|
if err := UpdateCurrency(&common.UpdateCurrency{ |
|
|
|
|
CurrencyBalance: &common.CurrencyBalance{ |
|
|
|
|
UID: or.UID, |
|
|
|
|
@ -451,6 +461,7 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa |
|
|
|
|
tx.Rollback() |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 退还代付券
|
|
|
|
|
// if or.Extra == "useFreeWithdraw" {
|
|
|
|
|
// if err := tx.Model(&common.PlayerItems{UID: uid}).Updates(map[string]interface{}{"free_withdraw": gorm.Expr("free_withdraw + 1")}).Error; err != nil {
|
|
|
|
|
|