正在显示
1 个修改的文件
包含
4 行增加
和
5 行删除
| @@ -57,15 +57,14 @@ func (deviceDailyRunningRecord *DeviceDailyRunningRecord) AddDeviceRunningData(d | @@ -57,15 +57,14 @@ func (deviceDailyRunningRecord *DeviceDailyRunningRecord) AddDeviceRunningData(d | ||
| 57 | t := data.CollectionTime | 57 | t := data.CollectionTime |
| 58 | deviceDailyRunningRecord.DeviceRunningRecordInfo.AddDeviceRunningData(t, data) | 58 | deviceDailyRunningRecord.DeviceRunningRecordInfo.AddDeviceRunningData(t, data) |
| 59 | now := time.Now().Unix() | 59 | now := time.Now().Unix() |
| 60 | - if ok, _ := data.Valid(); !ok { | ||
| 61 | - return false | ||
| 62 | - } | ||
| 63 | ts := t.Local().Unix() | 60 | ts := t.Local().Unix() |
| 61 | + deviceDailyRunningRecord.UpdatedAt = time.Now() | ||
| 64 | if ts > (now-DefaultCollectionTimeSpan) && ts < (now+DefaultCollectionTimeSpan) { | 62 | if ts > (now-DefaultCollectionTimeSpan) && ts < (now+DefaultCollectionTimeSpan) { |
| 65 | deviceDailyRunningRecord.UpdatedAt = t | 63 | deviceDailyRunningRecord.UpdatedAt = t |
| 66 | - return true | ||
| 67 | } | 64 | } |
| 68 | - deviceDailyRunningRecord.UpdatedAt = time.Now() | 65 | + if ok, _ := data.Valid(); !ok { |
| 66 | + return false | ||
| 67 | + } | ||
| 69 | return true | 68 | return true |
| 70 | } | 69 | } |
| 71 | 70 |
-
请 注册 或 登录 后发表评论