diff --git a/common/activity.go b/common/activity.go index 3b2f277..beb117c 100644 --- a/common/activity.go +++ b/common/activity.go @@ -566,7 +566,7 @@ type ConfigRtp struct { ID int `gorm:"column:id;type:int(11) AUTO_INCREMENT;primary_key"` MinRecharge int64 `gorm:"column:min_recharge;type:bigint(20);comment:最小充值" web:"min_recharge"` MaxRecharge int64 `gorm:"column:max_recharge;type:bigint(20);comment:最小充值" web:"max_recharge"` - Rtp int `gorm:"column:rtp;type:int(11);comment:rtp" json:"rtp" web:"rtp"` + Rtp int `gorm:"column:rtp;type:int(11);comment:rtp" web:"rtp"` EnterPer int `gorm:"column:enter_per;type:int(11);comment:进入提存比" web:"enter_per"` ExitPer int `gorm:"column:exit_per;type:int(11);comment:退出提存比" web:"exit_per"` } diff --git a/modules/backend/handler/guser/editGameUserGold.go b/modules/backend/handler/guser/editGameUserGold.go index 20cb6f3..f193ef2 100644 --- a/modules/backend/handler/guser/editGameUserGold.go +++ b/modules/backend/handler/guser/editGameUserGold.go @@ -51,12 +51,19 @@ func EditGameUserRtp(c *gin.Context) { if !a.S(req) { return } - err := db.Mysql().Update(&common.PlayerRtpData{Uid: req.UID}, map[string]interface{}{ - "rtp": req.Val, - }) - if err != nil { - a.Code = values.CodeRetry - a.Msg = "modify rtp error" + rtpData := &common.PlayerRtpData{Uid: req.UID} + db.Mysql().Get(rtpData) + if rtpData.Id == 0 { + rtpData.Rtp = req.Val + db.Mysql().Create(rtpData) + } else { + err := db.Mysql().Update(&common.PlayerRtpData{Uid: req.UID}, map[string]interface{}{ + "rtp": req.Val, + }) + if err != nil { + a.Code = values.CodeRetry + a.Msg = "modify rtp error" + } } a.RecordEdit(values.PowerGUser, fmt.Sprintf("修改玩家%vRtp:%v", req.UID, req.Val)) diff --git a/modules/backend/handler/guser/getGameUserInfo.go b/modules/backend/handler/guser/getGameUserInfo.go index 06bf0a5..dd928d8 100644 --- a/modules/backend/handler/guser/getGameUserInfo.go +++ b/modules/backend/handler/guser/getGameUserInfo.go @@ -93,13 +93,7 @@ func GetGameUserInfo(c *gin.Context) { // usdtInfo := call.GetPlayerRechargeInfoByCurrency(uid, common.CurrencyUSDT) resp.RechargeBrl = brlInfo.TotalRecharge resp.WithdrawBrl = brlInfo.TotalWithdraw - rtp := call.GetUserRtp(uid) - if rtp.Id == 0 { - db.Mysql().Create(rtp) - rtp.Rtp, _ = db.Redis().GetInt(common.GetRedisKeyPlayerRtp(uid)) - } else { - resp.Rtp = rtp.Rtp - } + resp.Rtp, _ = db.Redis().GetInt(common.GetRedisKeyPlayerRtp(uid)) // resp.RechargeUsdt = usdtInfo.TotalRecharge // resp.WithdrawUsdt = usdtInfo.TotoalWithdraw