package statistics import ( "server/common" "server/modules/backend/app" "server/modules/backend/models" utils "server/modules/backend/util" "server/modules/backend/values" "github.com/gin-gonic/gin" ) func PlayGameRoomData(c *gin.Context) { a := app.NewApp(c) defer func() { a.Response() }() req := new(values.PlayGameRoomDataReq) if !a.S(req) { return } resp := values.PlayGameRoomDataResp{} a.Data = resp } func getPlayGameRoomDataInfo(s, e *int64, channel *int, gameId *int, roomId *int, controlType int) values.PlayGameRoomDataInfo { var playGameRoomDataInfo values.PlayGameRoomDataInfo playGameRoomDataInfo.Date = *s playGameRoomDataInfo.GameId = *gameId playGameRoomDataInfo.ControlType = controlType event := int(common.CurrencyEventGameSettle) playGameRoomDataInfo.Amount = models.GetProfit(s, e, channel, gameId, roomId, &event, &controlType) playGameRoomDataInfo.GameCount = models.GetControlTotal(s, e, channel, gameId, roomId, &controlType, false) winCount := models.GetControlTotal(s, e, channel, gameId, roomId, &controlType, true) playGameRoomDataInfo.WinPer = utils.GetPer(winCount, playGameRoomDataInfo.GameCount) return playGameRoomDataInfo }