From a77f378156f1fb95fab707d0ad99d8390da74a3d Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Wed, 9 Aug 2023 22:42:15 +0800 Subject: [PATCH] last --- common/weixin/qyweixin.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/weixin/qyweixin.go b/common/weixin/qyweixin.go index d33f17c..e5b0010 100644 --- a/common/weixin/qyweixin.go +++ b/common/weixin/qyweixin.go @@ -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,14 +138,11 @@ 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 checkinTime < startTime { + startTime = checkinTime + } + if checkinTime > endTime { + endTime = checkinTime } } if startTime != int64(math.MaxInt64) {