作者 tangxvhui

bug 修复

@@ -19,6 +19,7 @@ type RankPeriod struct { @@ -19,6 +19,7 @@ type RankPeriod struct {
19 Status int8 `orm:"column(status);null" description:"状态 0:未开始 1:开始 2:结束 "` 19 Status int8 `orm:"column(status);null" description:"状态 0:未开始 1:开始 2:结束 "`
20 RankRangeBack string `orm:"column(rank_range_back)" description:"赛季结束时,备份赛季参与人设置"` 20 RankRangeBack string `orm:"column(rank_range_back)" description:"赛季结束时,备份赛季参与人设置"`
21 RankItemBack string `orm:"column(rank_item_back)" description:"赛季结束时,备份赛季评比项设置"` 21 RankItemBack string `orm:"column(rank_item_back)" description:"赛季结束时,备份赛季评比项设置"`
  22 + IsAuto int `orm:"column(is_auto)" description:"是否是自动创建的赛季【0:不是】【1:是】"`
22 } 23 }
23 24
24 func (t *RankPeriod) TableName() string { 25 func (t *RankPeriod) TableName() string {
@@ -28,7 +28,7 @@ type RankPeriodEndTime struct { @@ -28,7 +28,7 @@ type RankPeriodEndTime struct {
28 func AutoCreateRankPeriod() error { 28 func AutoCreateRankPeriod() error {
29 log.Info("计划任务:【自动创建赛季】") 29 log.Info("计划任务:【自动创建赛季】")
30 //获取需要执行自动创建的榜单记录 30 //获取需要执行自动创建的榜单记录
31 - sql1 := `ELECT a.id AS rank_type_id,a.auto_period,UNIX_TIMESTAMP(a.create_at) AS create_time 31 + sql1 := `SELECT a.id AS rank_type_id,a.auto_period,UNIX_TIMESTAMP(a.create_at) AS create_time
32 ,a.company_id 32 ,a.company_id
33 FROM rank_type AS a 33 FROM rank_type AS a
34 JOIN company AS b ON a.company_id=b.id AND b.enable=1 AND b.delete_at=0 34 JOIN company AS b ON a.company_id=b.id AND b.enable=1 AND b.delete_at=0
@@ -98,6 +98,7 @@ LOOP0: @@ -98,6 +98,7 @@ LOOP0:
98 CreateAt: nowTime, 98 CreateAt: nowTime,
99 UpdateAt: nowTime, 99 UpdateAt: nowTime,
100 Status: models.RANKPERIOD_STATUS_NOT, 100 Status: models.RANKPERIOD_STATUS_NOT,
  101 + IsAuto: 1,
101 } 102 }
102 if t, ok := rankPeriodMap[v.RankTypeId]; ok { 103 if t, ok := rankPeriodMap[v.RankTypeId]; ok {
103 s := time.Unix(t, 0).Format("2006-01-02") 104 s := time.Unix(t, 0).Format("2006-01-02")