diff --git a/worker/staff.go b/worker/staff.go index a7cac3c..644a94e 100644 --- a/worker/staff.go +++ b/worker/staff.go @@ -36,7 +36,7 @@ func (s *Staff) MontorWorkAge() { OfficialDate, _ := time.ParseInLocation("2006-01-02", staff.OfficialDate, time.Local) entryMonth := (nowDate.Year()-entryDate.Year())*12 + int(nowDate.Month()) - int(entryDate.Month()) - officelDay := (OfficialDate.Unix() - nowDate.Unix()) / 86400 + officalDay := (OfficialDate.Unix() - nowDate.Unix()) / 86400 log.Infof("staff[%s] entryDate[%s] spanMonth[%.1f]", staff.Username, staff.EntryDate, float64(entryMonth)/12.0) if nowDate.Day() == 1 && entryMonth%6 == 0 { message := make([]string, 0) @@ -52,7 +52,7 @@ func (s *Staff) MontorWorkAge() { } } - if officelDay <= 30 && officelDay%7 == 0 { + if officalDay > 0 && officalDay <= 30 && officalDay%7 == 0 { message := make([]string, 0) message = append(message, fmt.Sprintf("【员工转账提醒】[%s]", staff.Realname)) message = append(message, fmt.Sprintf("入职时间:%s", staff.EntryDate))