|
@@ -52,9 +52,9 @@ func updateHotKeys() {
|
|
|
})
|
|
|
c.AddFunc("0 0 1 * * 1", func() { //每周1清理匿名用户日志表 保留最近30天
|
|
|
tm := time.Now().AddDate(0, 0, -qutil.IntAllDef(config.Sysconfig["anonymousTime"], 30)).Unix()
|
|
|
- count := public.BaseMysql.CountBySql(fmt.Sprintf(`SELECT count(*) FROM anonymous_identity WHERE creation_time < %d and refer = '' and fid is null`, tm))
|
|
|
+ count := public.BaseMysql.CountBySql(fmt.Sprintf(`SELECT count(*) FROM anonymous_identity WHERE creation_time < %d and fid is null`, tm))
|
|
|
for i := 0; i < int(math.Ceil(float64(count)/float64(2000))); i++ {
|
|
|
- public.BaseMysql.SelectBySql(fmt.Sprintf(`DELETE FROM anonymous_identity WHERE creation_time < %d and refer = '' AND fid IS NULL LIMIT 2000;`, tm))
|
|
|
+ public.BaseMysql.SelectBySql(fmt.Sprintf(`DELETE FROM anonymous_identity WHERE creation_time < %d AND fid IS NULL LIMIT 2000;`, tm))
|
|
|
}
|
|
|
})
|
|
|
|