diff --git a/script/cp_pairs_stat.go b/script/cp_pairs_stat.go index b8ac878c5d7f8bad1ad6dc282f054fab36c4b33c..18fa460b4c3a263975dd2d52ff38579462e4c721 100644 --- a/script/cp_pairs_stat.go +++ b/script/cp_pairs_stat.go @@ -86,7 +86,7 @@ type CpLevel struct { } func main() { - var cpInfos []CpInfo + var cpInfos []*CpInfo if err := mysql.ProdReadOnlyDB.Table("cp_relation").Select("id,user_id1,user_id2,created_time").Find(&cpInfos).Error; err != nil { panic(err) } @@ -132,13 +132,13 @@ func main() { panic(err) } row := sheet.AddRow() - c1, c2, c3, c4, c5, c6, c7, c8 := row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell() - c1.Value, c2.Value, c3.Value, c4.Value, c5.Value, c6.Value, c7.Value, c8.Value = "cp ID", "userId1", "userId2", "user1区域", "user2区域", "等级", "积分", "绑定后充值金额 $" + c1, c2, c3, c4, c5, c6, c7, c8, c9 := row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell() + c1.Value, c2.Value, c3.Value, c4.Value, c5.Value, c6.Value, c7.Value, c8.Value, c9.Value = "cp ID", "userId1", "userId2", "user1区域", "user2区域", "等级", "积分", "绑定后充值金额 $", "绑定时间" for _, d := range cpInfos { row := sheet.AddRow() - c1, c2, c3, c4, c5, c6, c7, c8 := row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell() - c1.Value, c2.Value, c3.Value, c4.Value, c5.Value, c6.Value, c7.Value, c8.Value = - ats26(d.Id), ats26(d.Code1), ats26(d.Code2), ats26(d.UserId1Area), ats26(d.UserId2Area), ats26(d.Level), ats26(d.Points), ats26(d.Charge) + c1, c2, c3, c4, c5, c6, c7, c8, c9 := row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell(), row.AddCell() + c1.Value, c2.Value, c3.Value, c4.Value, c5.Value, c6.Value, c7.Value, c8.Value, c9.Value = + ats26(d.Id), ats26(d.Code1), ats26(d.Code2), ats26(d.UserId1Area), ats26(d.UserId2Area), ats26(d.Level), ats26(d.Points), ats26(d.Charge), ats26(d.CreatedTime.Format("2006-01-02 15:04:05")) } _ = xlFile.Save(excelFileName)