This commit is contained in:
jiangyong27 2023-08-09 22:42:15 +08:00
parent a2a89508e6
commit a77f378156
1 changed files with 5 additions and 9 deletions

View File

@ -131,7 +131,6 @@ func (q *QyWeixin) GetCheckinData(day, userId string) (*UserCheckIn, error) {
endTime := int64(0)
for _, checkdata := range checkindatas {
c := cast.ToStringMap(checkdata)
checkinType := cast.ToString(c["checkin_type"])
exceptionType := cast.ToString(c["exception_type"])
checkinTime := cast.ToInt64(c["checkin_time"])
if exceptionType != "" {
@ -139,16 +138,13 @@ func (q *QyWeixin) GetCheckinData(day, userId string) (*UserCheckIn, error) {
}
exception = append(exception, exceptionType)
if checkinType == "上班打卡" {
if checkinTime < startTime {
startTime = checkinTime
}
} else if checkinType == "下班打卡" {
if checkinTime > endTime {
endTime = checkinTime
}
}
}
if startTime != int64(math.MaxInt64) {
userData.StartTime = startTime
}