印度包网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.4 KiB

1 year ago
package guser
import (
"fmt"
"server/call"
"server/common"
"server/db"
1 year ago
"server/modules/backend/app"
"server/modules/backend/values"
"github.com/gin-gonic/gin"
"github.com/liangdas/mqant/log"
)
// 修改玩家金币
func EditGameUserGold(c *gin.Context) {
a := app.NewApp(c)
defer func() {
a.Response()
}()
req := new(values.EditGameUserGoldReq)
if !a.S(req) {
return
}
user, _ := call.GetUserXInfo(req.UID, "channel_id")
update := &common.UpdateCurrency{
CurrencyBalance: &common.CurrencyBalance{
UID: req.UID,
Type: req.CurrencyType,
Value: req.Amount,
Event: common.CurrencyEventGM,
ChannelID: user.ChannelID,
Exs1: "后台操作修改玩家金币",
},
}
err := call.MineCurrencyProReal(update).Err
if err != nil {
log.Error("err:%v", err)
a.Code = values.CodeRetry
return
}
a.RecordEdit(values.PowerGUser, fmt.Sprintf("修改玩家%v金币:%v", req.UID, req.Amount))
}
func EditGameUserRtp(c *gin.Context) {
a := app.NewApp(c)
defer func() {
a.Response()
}()
req := new(values.EditGameUserRtpReq)
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"
}
a.RecordEdit(values.PowerGUser, fmt.Sprintf("修改玩家%vRtp:%v", req.UID, req.Val))
}