From 15f77196f65e68ed6fa71e1b60dd06aa88cef007 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Fri, 14 Mar 2025 13:06:49 +0800 Subject: [PATCH] personal --- server/api/salary.go | 7 ++++--- server/service/staff_salary.go | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/api/salary.go b/server/api/salary.go index def52f5..fe8cace 100644 --- a/server/api/salary.go +++ b/server/api/salary.go @@ -36,9 +36,10 @@ type CreateSalaryReq struct { } type UpdateSalaryReq struct { - Id string `json:"id"` - OtherIncome string `json:"other_income"` - OtherDeduct string `json:"other_deduct"` + Id string `json:"id"` + OtherIncome string `json:"other_income"` + OtherDeduct string `json:"other_deduct"` + PersonalDeduct string `json:"personal_deduct"` } type ListSalaryReq struct { diff --git a/server/service/staff_salary.go b/server/service/staff_salary.go index b099bba..ab9286c 100644 --- a/server/service/staff_salary.go +++ b/server/service/staff_salary.go @@ -106,6 +106,9 @@ func (s *StaffSalary) Update(sess *session.AdminSession, req *api.UpdateSalaryRe if req.OtherDeduct != "" { salary.OtherDeduct = cast.ToFloat64(req.OtherDeduct) } + if req.PersonalDeduct != "" { + salary.PersonalDeduct = cast.ToFloat64(req.PersonalDeduct) + } err = dao.NewStaffSalaryDao().Update(salary) session.CheckDBError(err) }