作者 tangxvhui

bug 修复

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