From cb659df6f334aa3891e9474648098f24e54d2a89 Mon Sep 17 00:00:00 2001 From: mofangmin Date: Thu, 12 Sep 2024 18:06:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=8E=E5=8F=B0RTP=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/handler/guser/editGameUserGold.go | 19 +++++++++++++------ .../backend/handler/guser/getGameUserInfo.go | 8 +------- 2 files changed, 14 insertions(+), 13 deletions(-) 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 From 4df4eb81978d5e58e7dc8142fe29b7bac13991a3 Mon Sep 17 00:00:00 2001 From: mofangmin Date: Fri, 13 Sep 2024 15:09:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?rtp=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/activity.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/activity.go b/common/activity.go index a778638..15a8655 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"` }