Commit f44d7fed authored by hujiebin's avatar hujiebin

feat:加上绑定time

parent f20aca1a
...@@ -86,7 +86,7 @@ type CpLevel struct { ...@@ -86,7 +86,7 @@ type CpLevel struct {
} }
func main() { 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 { if err := mysql.ProdReadOnlyDB.Table("cp_relation").Select("id,user_id1,user_id2,created_time").Find(&cpInfos).Error; err != nil {
panic(err) panic(err)
} }
...@@ -132,13 +132,13 @@ func main() { ...@@ -132,13 +132,13 @@ func main() {
panic(err) panic(err)
} }
row := sheet.AddRow() 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, 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 = "cp ID", "userId1", "userId2", "user1区域", "user2区域", "等级", "积分", "绑定后充值金额 $" 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 { for _, d := range cpInfos {
row := sheet.AddRow() 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, 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 = 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.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) _ = xlFile.Save(excelFileName)
......
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