by Robin at 20240412
This commit is contained in:
parent
156cc92de9
commit
e986f9ba07
|
@ -214,3 +214,8 @@ const (
|
|||
IsHeaded_No = 0 //否
|
||||
IsHeaded_Yes = 1 //是
|
||||
)
|
||||
|
||||
// 从未更新的时间跨度
|
||||
const (
|
||||
DaysElapsedSinceTheLastZonesUpdate_Never = -1
|
||||
)
|
||||
|
|
|
@ -763,8 +763,17 @@ func (s *Service) utilGetStreamerExtMapByMids(ctx *gin.Context, mids []int64, op
|
|||
streamerExt.CopyZones(zonesMap[mid])
|
||||
// 计算空间更新时间距离现在时间跨度
|
||||
nowTime := time.Now()
|
||||
lastZoneMomentCt := int64(0)
|
||||
for _, zone := range zonesMap[mid] {
|
||||
lastZoneMomentCreateDay := util.GetDayStartTimeStamp(time.Unix(util.DerefInt64(zone.LastZoneMomentCt), 0))
|
||||
if util.DerefInt64(zone.LastZoneMomentCt) > lastZoneMomentCt {
|
||||
lastZoneMomentCt = util.DerefInt64(zone.LastZoneMomentCt)
|
||||
}
|
||||
}
|
||||
if lastZoneMomentCt == 0 {
|
||||
streamerExt.SetIsActiveWithinAWeek(consts.ZoneIsActiveWithinAWeek_No)
|
||||
streamerExt.SetDaysElapsedSinceTheLastZonesUpdate(consts.DaysElapsedSinceTheLastZonesUpdate_Never)
|
||||
} else {
|
||||
lastZoneMomentCreateDay := util.GetDayStartTimeStamp(time.Unix(lastZoneMomentCt, 0))
|
||||
today := util.GetDayStartTimeStamp(nowTime)
|
||||
daysElapsedSinceTheLastZonesUpdate := (today - lastZoneMomentCreateDay) / int64(86400) // 24 * 60 * 60 = 86400秒
|
||||
streamerExt.SetDaysElapsedSinceTheLastZonesUpdate(daysElapsedSinceTheLastZonesUpdate)
|
||||
|
|
Loading…
Reference in New Issue