Browse Source

update

master
dengbiao 3 weeks ago
parent
commit
760ac82477
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      utils/es/base.go

+ 14
- 1
utils/es/base.go View File

@@ -22,10 +22,23 @@ func GetLatestEffectiveIndexFromAlias(now time.Time) string {
year, week := now.ISOWeek()
if now.Weekday() > time.Wednesday || (now.Weekday() > time.Wednesday && now.Hour() > 14) {
// 当前已经过了周三下午两点 返回上周蛋蛋分
esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week)
esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week-1)
} else {
// 没过周三下午两点 返回上上周蛋蛋分
esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week-2)
}
return esIndexName
}

func GetLatestEffectiveIndexFromAliasForAdmin(now time.Time) string {
var esIndexName string
year, week := now.ISOWeek()
if now.Weekday() > time.Tuesday || (now.Weekday() > time.Tuesday && now.Hour() > 18) {
// 当前已经过了周三下午两点 返回本周蛋蛋分
esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week)
} else {
// 没过周三下午两点 返回上周蛋蛋分
esIndexName = egg_system_rules.IntToStr(year) + egg_system_rules.IntToStr(week-1)
}
return esIndexName
}

Loading…
Cancel
Save