package guser import ( "github.com/gin-gonic/gin" "github.com/liangdas/mqant/log" "server/common" "server/modules/backend/models" utils "server/modules/backend/util" "server/modules/backend/values" "server/modules/customer/app" ) func ControlCardData(c *gin.Context) { a := app.NewApp(c) defer func() { a.Response() }() req := new(values.ControlCardDataReq) if !a.S(req) { return } var resp values.ControlCardDataResp event := int(common.CurrencyEventGameSettle) s, e := utils.GetQueryUnix(req.Start, req.End) var balance []common.CurrencyBalance count, err := models.QueryPlayerAllBalance(req.Uid, req.Page-1, req.Num, &s, &e, req.GameId, req.RoomId, req.ControlType, req.Channel, &event, &balance) if err != nil { log.Error("err:%v", err) a.Code = values.CodeRetry return } //MillionGameIdMap := make(map[string]bool) //for i := 0; i < len(common.MillionGameIDs); i++ { // MillionGameIdMap[strconv.Itoa(common.MillionGameIDs[i].(int))] = true //} // //for i := 0; i < len(balance); i++ { // var playerBalance values.PlayerBalance // playerBalance.CurrencyBalance = balance[i] // // if _, ok := MillionGameIdMap[balance[i].Desc]; ok { // playerBalance.MillionBetArea, playerBalance.Result = getMillionBetArea(balance[i].Extern, balance[i].Uid) // } // // resp.List = append(resp.List, playerBalance) //} resp.Total = count a.Data = resp } func getAndarBaharArea(res int) string { if 1 <= res && res <= 5 { return "2" } if 6 <= res && res <= 10 { return "3" } if 11 <= res && res <= 15 { return "4" } if 16 <= res && res <= 25 { return "5" } if 26 <= res && res <= 30 { return "6" } if 31 <= res && res <= 35 { return "7" } if 36 <= res && res <= 40 { return "8" } if 41 <= res && res <= 100 { return "9" } return "-1" }