Commit 685f3f58 authored by hujiebin's avatar hujiebin

1

parent 5922a58b
...@@ -14,10 +14,16 @@ type Msg struct { ...@@ -14,10 +14,16 @@ type Msg struct {
GameType int `json:"gameType"` GameType int `json:"gameType"`
} }
var GameTypeMap = map[int]string{
0: "slot",
5: "幸运盒子",
6: "水果机",
}
func main() { func main() {
var rpcLogs []RpcLog var rpcLogs []RpcLog
if err := mysql.ProdReadOnlyDB.Table("rpc_log_202303 ").Where("`type` = 146"). if err := mysql.ProdReadOnlyDB.Table("rpc_log_202303 ").Where("`type` = 146").
Where("created_time >= ? and created_time < ?", "2023-03-08", "2023-03-09").Find(&rpcLogs).Error; err != nil { Where("created_time >= ? and created_time < ?", "2023-03-09", "2023-03-13").Find(&rpcLogs).Error; err != nil {
panic(err) panic(err)
} }
var data = make(map[int]int) var data = make(map[int]int)
...@@ -29,6 +35,6 @@ func main() { ...@@ -29,6 +35,6 @@ func main() {
data[msg.GameType]++ data[msg.GameType]++
} }
for gameType, count := range data { for gameType, count := range data {
println(gameType, count) println(GameTypeMap[gameType], count)
} }
} }
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment