diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index 958f696..c43ee37 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -124,14 +124,6 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { break } - _, err = GetCashFromSDK(uuid, drawnum, rdata.Gameid, rdata.Channel, rdata.Openid, rdata.Nickname, rdata.Headurl, rdata.Ver) - if err != nil { - logger.Error("GetCashFromSDK failed err=%v", err) - resp.Message = "从后台提现失败了" - resp.Code = ERROR_GETCASH_FAILED - break - } - index, info := uinfo.GetWithDrawData(rdata.Money) if index == -1 || info == nil { logger.Error("AddWithDrawList failed err=%v", err) @@ -170,6 +162,14 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { } } + gold, err := GetCashFromSDK(uuid, drawnum, rdata.Gameid, rdata.Channel, rdata.Openid, rdata.Nickname, rdata.Headurl, rdata.Ver) + if err != nil { + logger.Error("GetCashFromSDK failed err=%v", err) + resp.Message = "从后台提现失败了" + resp.Code = ERROR_GETCASH_FAILED + break + } + //需要保存一下提现记录 /*data := new(WithDrawRecord) data.Withdrawmoney = rdata.Money @@ -186,8 +186,8 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { uinfo.WithDraw.Cashdata[index].Isnew = 0 } - //uinfo.RealGold = - uinfo.RealGold -= drawnum * 100 + uinfo.RealGold = gold + //uinfo.RealGold -= drawnum * 100 resp.Data.Walletgold = uinfo.RealGold SaveUserInfo(uinfo) -- libgit2 0.21.0