| | |
| | | sTime := tmpTime |
| | | eTime := tmpTime |
| | | stayTime := 0.0 |
| | | if startTime != "" && point < indexLength{ |
| | | if startTime != "" && point <= indexLength{ |
| | | sinTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, loc) |
| | | passTime := math.Abs(mTime.Sub(sinTime).Seconds()) |
| | | //fmt.Println("passTime: ", passTime) |
| | | if passTime <= thresholdTime { |
| | | startTime = tmpTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | if point == indexLength{ |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | } |
| | | continue |
| | | } else { |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | //fmt.Println("hitStartTime: ",hitStartTime) |
| | | //fmt.Println("realStartTime: ",realStartTime) |
| | | //fmt.Println("mTime: ",mTime) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | //fmt.Println("stayTime: ",stayTime) |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | |
| | | sTime := tmpTime |
| | | eTime := tmpTime |
| | | stayTime := 0.0 |
| | | if startTime != "" && point < indexLength{ |
| | | if startTime != "" && point <= indexLength{ |
| | | sinTime, _ := time.ParseInLocation("2006-01-02 15:04:05", startTime, loc) |
| | | passTime := math.Abs(mTime.Sub(sinTime).Seconds()) |
| | | //fmt.Println("passTime: ", passTime) |
| | | if passTime <= thresholdTime { |
| | | if passTime <= thresholdTime || point == indexLength{ |
| | | startTime = tmpTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | if point == indexLength{ |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | } |
| | | continue |
| | | } else { |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |