|
|
@@ -18,7 +18,8 @@ func GetAppointIndexFromAlias(year string, week string) string { |
|
|
|
// GetLatestEffectiveIndexFromAlias 获取最新有效别名 |
|
|
|
// TODO::临时默认全是60分 |
|
|
|
func GetLatestEffectiveIndexFromAlias(now time.Time) string { |
|
|
|
if now.Weekday() > time.Wednesday || (now.Weekday() > time.Wednesday && now.Hour() > 14) { |
|
|
|
//if now.Weekday() > time.Wednesday || (now.Weekday() > time.Wednesday && now.Hour() > 14) { |
|
|
|
if now.Weekday() > time.Friday || (now.Weekday() > time.Friday && now.Hour() > 14) { |
|
|
|
// 当前已经过了周三下午两点 返回上周蛋蛋分 |
|
|
|
now = now.AddDate(0, 0, -7*2) |
|
|
|
} else { |
|
|
@@ -30,8 +31,8 @@ func GetLatestEffectiveIndexFromAlias(now time.Time) string { |
|
|
|
} |
|
|
|
|
|
|
|
func GetLatestEffectiveIndexFromAliasForAdmin(now time.Time) string { |
|
|
|
if !(now.Weekday() > time.Tuesday || (now.Weekday() > time.Tuesday && now.Hour() > 18)) { |
|
|
|
// 没过周三下午两点 返回上周蛋蛋分 |
|
|
|
if !(now.Weekday() > time.Friday || (now.Weekday() > time.Friday && now.Hour() > 18)) { |
|
|
|
// 没过周二下午六点 返回上周蛋蛋分 |
|
|
|
now = now.AddDate(0, 0, -7) |
|
|
|
} |
|
|
|
year, week := now.ISOWeek() |
|
|
|