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.
42 lines
939 B
42 lines
939 B
package guser |
|
|
|
import ( |
|
"fmt" |
|
"server/call" |
|
"server/common" |
|
"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)) |
|
}
|
|
|