|
@@ -668,8 +668,32 @@ func (s *LogicalLog) GetStatisticsComputerRate(ctx context.Context, pcCode strin
|
|
|
key := fmt.Sprintf(GameComputerRateCacheKey, s.CurrentDate(), pcCode)
|
|
key := fmt.Sprintf(GameComputerRateCacheKey, s.CurrentDate(), pcCode)
|
|
|
key = key + "*"
|
|
key = key + "*"
|
|
|
data, _ := s.cache.GetCacheKeys(ctx, key)
|
|
data, _ := s.cache.GetCacheKeys(ctx, key)
|
|
|
|
|
+ h := map[string]int{
|
|
|
|
|
+ "2": 1,
|
|
|
|
|
+ "3": 1,
|
|
|
|
|
+ "4": 1,
|
|
|
|
|
+ "5": 1,
|
|
|
|
|
+ "6": 1,
|
|
|
|
|
+ "7": 1,
|
|
|
|
|
+ "8": 1,
|
|
|
|
|
+ }
|
|
|
|
|
+ var i = 0
|
|
|
|
|
+ for _, v := range data {
|
|
|
|
|
+ key := strings.Split(v, ":")
|
|
|
|
|
+ hr := key[len(key)-1:][0]
|
|
|
|
|
+ if _, ok := h[hr]; ok {
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
|
|
+ i++
|
|
|
|
|
+ }
|
|
|
hour := time.Now().Hour()
|
|
hour := time.Now().Hour()
|
|
|
- num = hour + 1 - len(data)
|
|
|
|
|
|
|
+ //num = hour + 1 - len(data)
|
|
|
|
|
+ if hour >= 8 {
|
|
|
|
|
+ num = hour + 1 - 7 - i
|
|
|
|
|
+ } else {
|
|
|
|
|
+ notCalculated := hour - 2
|
|
|
|
|
+ num = hour + 1 - notCalculated - i
|
|
|
|
|
+ }
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|