| | |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | startTime = "" |
| | | } else { |
| | | startTime = tmpTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | continue |
| | | } |
| | | |
| | | continue |
| | | } else { |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | hitEndTime := hitsSources[len(hitsSources)-1]["endTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | realEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitEndTime, loc) |
| | | stayTime = math.Abs(realEndTime.Sub(realStartTime).Seconds()) |
| | | if sinTime.Sub(mTime).Seconds() == 0 { |
| | | if sinTime.Sub(mTime).Seconds() == 0{ |
| | | sinTime.Add(time.Second * 1) |
| | | sinTime.Format("2006-01-02 15:04:05") |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | stayTime = 1 |
| | | } else if stayTime == 0{ |
| | | stayTime = 1 |
| | | hitsSources[len(hitsSources)-1]["endTime"] = realEndTime.Add(time.Second*1).Format("2006-01-02 15:04:05") |
| | | } |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | if point == indexLength { |
| | |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | startTime = "" |
| | | } else { |
| | | startTime = tmpTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | continue |
| | | } |
| | | |
| | | continue |
| | | } else { |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | hitEndTime := hitsSources[len(hitsSources)-1]["endTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | realEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitEndTime, loc) |
| | | stayTime = math.Abs(realEndTime.Sub(realStartTime).Seconds()) |
| | | if sinTime.Sub(mTime).Seconds() == 0 { |
| | | if sinTime.Sub(mTime).Seconds() == 0{ |
| | | sinTime.Add(time.Second * 1) |
| | | sinTime.Format("2006-01-02 15:04:05") |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | stayTime = 1 |
| | | } else if stayTime == 0{ |
| | | stayTime = 1 |
| | | hitsSources[len(hitsSources)-1]["endTime"] = realEndTime.Add(time.Second*1).Format("2006-01-02 15:04:05") |
| | | } |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | if point == indexLength { |
| | |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | stayTime = math.Abs(mTime.Sub(realStartTime).Seconds()) |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | startTime = "" |
| | | } else { |
| | | startTime = tmpTime |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | continue |
| | | } |
| | | |
| | | continue |
| | | } else { |
| | | hitStartTime := hitsSources[len(hitsSources)-1]["startTime"].(string) |
| | | hitEndTime := hitsSources[len(hitsSources)-1]["endTime"].(string) |
| | | realStartTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitStartTime, loc) |
| | | realEndTime, _ := time.ParseInLocation("2006-01-02 15:04:05", hitEndTime, loc) |
| | | stayTime = math.Abs(realEndTime.Sub(realStartTime).Seconds()) |
| | | if sinTime.Sub(mTime).Seconds() == 0 { |
| | | if sinTime.Sub(mTime).Seconds() == 0{ |
| | | sinTime.Add(time.Second * 1) |
| | | sinTime.Format("2006-01-02 15:04:05") |
| | | hitsSources[len(hitsSources)-1]["endTime"] = tmpTime |
| | | stayTime = 1 |
| | | } else if stayTime == 0{ |
| | | stayTime = 1 |
| | | hitsSources[len(hitsSources)-1]["endTime"] = realEndTime.Add(time.Second*1).Format("2006-01-02 15:04:05") |
| | | } |
| | | hitsSources[len(hitsSources)-1]["stayTime"] = stayTime |
| | | if point == indexLength { |