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