From fb73e8b0842e6832255cf0affe0d21beb05d0c47 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Sat, 29 Mar 2025 17:54:49 +0800 Subject: [PATCH] summary --- server/service/staff_salary.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/service/staff_salary.go b/server/service/staff_salary.go index 9872c62..3d9cc9f 100644 --- a/server/service/staff_salary.go +++ b/server/service/staff_salary.go @@ -48,10 +48,7 @@ func (s *StaffSalary) List(sess *session.AdminSession, req *api.ListSalaryReq) ( for pos, m := range salarys { staffSalary := new(api.Salary) staffSalary.From(m) - summary.Add(staffSalary) - if pos < start || pos >= end { - continue - } + staffUser, err := dao.NewStaffUserDao().Get(m.UserId) session.CheckDBError(err) if staffUser != nil { @@ -60,6 +57,12 @@ func (s *StaffSalary) List(sess *session.AdminSession, req *api.ListSalaryReq) ( staffSalary.TargetSalary = userSalary.Target staffSalary.BaseSalary = userSalary.Base } + + summary.Add(staffSalary) + if pos < start || pos >= end { + continue + } + items = append(items, staffSalary) }