diff --git a/script/fruit_day_award.go b/script/fruit_day_award.go index 416cd0d5cb6c1307ce99ab156320674a21b07949..b546f1553e2d6419776e0e6edae450e138a576d7 100644 --- a/script/fruit_day_award.go +++ b/script/fruit_day_award.go @@ -41,7 +41,7 @@ func ats32(a interface{}) string { } func main() { - url := "https://apiv2.faceline.live/v1/fruitMachine/rank/award?lang=zh-cn&pageIndex=1&pageSize=50000&beginDate=2023-08-20&endDate=2023-08-20&userCode=&timezone=1" + url := "https://apiv2.faceline.live/v1/fruitMachine/rank/award?lang=zh-cn&pageIndex=1&pageSize=5000&beginDate=2023-08-21&endDate=2023-08-21&userCode=&timezone=1" method := "GET" client := &http.Client{} @@ -95,7 +95,7 @@ func main() { for _, v := range svips { svipMap[v.Code] = v.Level } - excelFileName := fmt.Sprintf("./0820水果机中奖榜.xlsx") + excelFileName := fmt.Sprintf("./0821水果机中奖榜.xlsx") xlFile := xlsx.NewFile() sheet, _ := xlFile.AddSheet("charge") row := sheet.AddRow() diff --git a/script/test_game_banner.go b/script/test_game_banner.go index 2e6761cea3c5178f5f22dcb2fc7ab376be998ad7..adf5c98d74be4c21756f6be04a56e32e16e6e4ff 100644 --- a/script/test_game_banner.go +++ b/script/test_game_banner.go @@ -5,6 +5,8 @@ import ( "git.hilo.cn/hilo-common/script/mysql" ) +// cat 146.json | grep 'gameId\\"\:17' | wc -l +// 如果mysql navicate中导出json,可以用上面的命令,是准确的。 type RpcLog struct { Type int Msg string @@ -12,18 +14,20 @@ type RpcLog struct { type Msg struct { GameType int `json:"gameType"` + GameId int `json:"gameId"` } var GameTypeMap = map[int]string{ - 0: "slot", - 5: "幸运盒子", - 6: "水果机", + //0: "slot", + //5: "幸运盒子", + //6: "水果机", + 17: "赛车", } func main() { var rpcLogs []RpcLog - if err := mysql.ProdReadOnlyDB.Table("rpc_log_202303 ").Where("`type` = 146"). - Where("created_time >= ? and created_time < ?", "2023-03-09", "2023-03-13").Find(&rpcLogs).Error; err != nil { + if err := mysql.ProdReadOnlyDB.Table("rpc_log_202308").Where("`type` = 146"). + Where("created_time >= ?", "2023-08-22 15:57:49").Find(&rpcLogs).Error; err != nil { panic(err) } var data = make(map[int]int) @@ -32,9 +36,9 @@ func main() { if err := json.Unmarshal([]byte(log.Msg), msg); err != nil { panic(err) } - data[msg.GameType]++ + data[msg.GameId]++ } - for gameType, count := range data { - println(GameTypeMap[gameType], count) + for gameId, count := range data { + println(GameTypeMap[gameId], count) } }