other income

This commit is contained in:
jiangyong27 2025-03-13 11:51:35 +08:00
parent 8184ba2f16
commit b0019d8837
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ type CreateSalaryReq struct {
type UpdateSalaryReq struct { type UpdateSalaryReq struct {
Id string `json:"month"` Id string `json:"month"`
OtherSalary string `json:"other_salary"` OtherIncome string `json:"other_income"`
OtherDeduct string `json:"other_deduct"` OtherDeduct string `json:"other_deduct"`
} }

View File

@ -69,8 +69,8 @@ func (s *StaffSalary) Update(sess *session.AdminSession, req *api.UpdateSalaryRe
salary, err := dao.NewStaffSalaryDao().Get(cast.ToInt64(req.Id)) salary, err := dao.NewStaffSalaryDao().Get(cast.ToInt64(req.Id))
session.CheckDBError(err) session.CheckDBError(err)
session.CheckNilError(salary, "工资单不存在") session.CheckNilError(salary, "工资单不存在")
if req.OtherSalary != "" { if req.OtherIncome != "" {
salary.OtherSalary = cast.ToFloat64(req.OtherSalary) salary.OtherSalary = cast.ToFloat64(req.OtherIncome)
} }
if req.OtherDeduct != "" { if req.OtherDeduct != "" {
salary.OtherDeduct = cast.ToFloat64(req.OtherDeduct) salary.OtherDeduct = cast.ToFloat64(req.OtherDeduct)