From ccf1c3a7014c931ff5998c7b36c3153718c2d5aa Mon Sep 17 00:00:00 2001 From: hujiebin Date: Wed, 21 Jun 2023 15:57:55 +0800 Subject: [PATCH] Update cp_pairs_stat.go --- script/cp_pairs_stat.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/cp_pairs_stat.go b/script/cp_pairs_stat.go index d55a626..4540411 100644 --- a/script/cp_pairs_stat.go +++ b/script/cp_pairs_stat.go @@ -83,6 +83,7 @@ type CpInfo struct { type CpLevel struct { CpId uint64 Level uint64 + Points uint64 CreatedTime time.Time } @@ -96,7 +97,7 @@ func main() { cpIds = append(cpIds, v.Id) } var cpLevels []CpLevel - if err := mysql.ProdReadOnlyDB.Table("cp_level").Select("cp_id,level,created_time").Where("cp_id in ?", cpIds).Find(&cpLevels).Error; err != nil { + if err := mysql.ProdReadOnlyDB.Table("cp_level").Select("cp_id,level,points,created_time").Where("cp_id in ?", cpIds).Find(&cpLevels).Error; err != nil { panic(err) } var userIds []uint64 @@ -107,6 +108,7 @@ func main() { for _, v2 := range cpLevels { if v.Id == v2.CpId { cpInfos[i].Level = v2.Level + cpInfos[i].Points = v2.Points cpInfos[i].CreatedTime = v2.CreatedTime break } -- 2.22.0