Commit ccf1c3a7 authored by hujiebin's avatar hujiebin

Update cp_pairs_stat.go

parent e3be2346
...@@ -83,6 +83,7 @@ type CpInfo struct { ...@@ -83,6 +83,7 @@ type CpInfo struct {
type CpLevel struct { type CpLevel struct {
CpId uint64 CpId uint64
Level uint64 Level uint64
Points uint64
CreatedTime time.Time CreatedTime time.Time
} }
...@@ -96,7 +97,7 @@ func main() { ...@@ -96,7 +97,7 @@ func main() {
cpIds = append(cpIds, v.Id) cpIds = append(cpIds, v.Id)
} }
var cpLevels []CpLevel 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) panic(err)
} }
var userIds []uint64 var userIds []uint64
...@@ -107,6 +108,7 @@ func main() { ...@@ -107,6 +108,7 @@ func main() {
for _, v2 := range cpLevels { for _, v2 := range cpLevels {
if v.Id == v2.CpId { if v.Id == v2.CpId {
cpInfos[i].Level = v2.Level cpInfos[i].Level = v2.Level
cpInfos[i].Points = v2.Points
cpInfos[i].CreatedTime = v2.CreatedTime cpInfos[i].CreatedTime = v2.CreatedTime
break break
} }
......
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