From ac2e7666f37ecc3d4b44b9c1b4de0ea2a0045f08 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Tue, 1 Apr 2025 18:29:31 +0800 Subject: [PATCH] tags --- server/api/salary.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/api/salary.go b/server/api/salary.go index 3fb882b..fb06092 100644 --- a/server/api/salary.go +++ b/server/api/salary.go @@ -29,6 +29,7 @@ type Salary struct { UpdateTime string `json:"update_time,omitempty"` Extra string `json:"extra,omitempty"` Status string `json:"status,omitempty"` + Tags string `json:"tags,omitempty"` } type CreateSalaryReq struct { @@ -77,6 +78,12 @@ func (s *Salary) From(m *model.StaffSalary) { s.UpdateTime = goutil.TimeToDateTime(m.UpdateTime) s.Extra = m.Extra s.Status = cast.ToString(m.Status) + + if s.AttendDay+s.HolidayDay != s.ShouldDay { + s.Tags = "出勤异常" + } else { + s.Tags = "出勤正常" + } } func (s *Salary) Add(o *Salary) {