From d29c37250af461d9a9a7fbf1305d87dc15baa4e9 Mon Sep 17 00:00:00 2001 From: jiangyong Date: Mon, 10 Mar 2025 00:21:41 +0800 Subject: [PATCH] check --- service/staff_salary.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service/staff_salary.go b/service/staff_salary.go index 4609e52..9601d5b 100644 --- a/service/staff_salary.go +++ b/service/staff_salary.go @@ -188,8 +188,10 @@ func (s *StaffSalary) getRealWorkDay(month string) float64 { } //其他按工作时长结算 - duration := float64(checkin.EndTime-checkin.StartTime) / cast.ToFloat64(corp.GetConfig().WorkerHouer) - realWorkdays += goutil.If(duration > 1, 1, duration) + if checkin.EndTime > 0 && checkin.StartTime > 0 { + duration := float64(checkin.EndTime-checkin.StartTime) / cast.ToFloat64(corp.GetConfig().WorkerHouer) + realWorkdays += goutil.If(duration > 1, 1, duration) + } } return realWorkdays }