diff --git a/server/api/salary.go b/server/api/salary.go index 4624cde..972faa5 100644 --- a/server/api/salary.go +++ b/server/api/salary.go @@ -36,7 +36,7 @@ type CreateSalaryReq struct { type UpdateSalaryReq struct { Id string `json:"month"` - OtherSalary string `json:"other_salary"` + OtherIncome string `json:"other_income"` OtherDeduct string `json:"other_deduct"` } diff --git a/server/service/staff_salary.go b/server/service/staff_salary.go index 304524b..dd1d83a 100644 --- a/server/service/staff_salary.go +++ b/server/service/staff_salary.go @@ -69,8 +69,8 @@ func (s *StaffSalary) Update(sess *session.AdminSession, req *api.UpdateSalaryRe salary, err := dao.NewStaffSalaryDao().Get(cast.ToInt64(req.Id)) session.CheckDBError(err) session.CheckNilError(salary, "工资单不存在") - if req.OtherSalary != "" { - salary.OtherSalary = cast.ToFloat64(req.OtherSalary) + if req.OtherIncome != "" { + salary.OtherSalary = cast.ToFloat64(req.OtherIncome) } if req.OtherDeduct != "" { salary.OtherDeduct = cast.ToFloat64(req.OtherDeduct)