|
@@ -282,12 +282,12 @@ func (c *OvertimeController) Overtime_Stat() {
|
|
T_uuid = c.User.T_uuid
|
|
T_uuid = c.User.T_uuid
|
|
}
|
|
}
|
|
|
|
|
|
- attendance, cnt := Attendance.Read_Attendance_List_For_Stat(T_uuid, page, page_z)
|
|
|
|
|
|
+ attendance, cnt := Attendance.Read_Attendance_List_For_Stat(T_uuid, 0, 9999)
|
|
|
|
|
|
userList, _ := NatsServer.Read_User_List_All()
|
|
userList, _ := NatsServer.Read_User_List_All()
|
|
Account.Read_User_All_Map(userList)
|
|
Account.Read_User_All_Map(userList)
|
|
var duration int
|
|
var duration int
|
|
- for i := 0; i < len(attendance); i++ {
|
|
|
|
|
|
+ for i := len(attendance) - 1; i >= 0; i-- {
|
|
if attendance[i].T_type == Attendance.AttendanceDaysOff || attendance[i].T_type == Attendance.AttendanceShiftPerf || attendance[i].T_type > 100 {
|
|
if attendance[i].T_type == Attendance.AttendanceDaysOff || attendance[i].T_type == Attendance.AttendanceShiftPerf || attendance[i].T_type > 100 {
|
|
duration -= attendance[i].T_duration
|
|
duration -= attendance[i].T_duration
|
|
attendance[i].T_duration = -attendance[i].T_duration
|
|
attendance[i].T_duration = -attendance[i].T_duration
|
|
@@ -308,9 +308,14 @@ func (c *OvertimeController) Overtime_Stat() {
|
|
}
|
|
}
|
|
|
|
|
|
var r_jsons R_JSONS
|
|
var r_jsons R_JSONS
|
|
|
|
+ offset := (page - 1) * page_z
|
|
|
|
+ limit := offset + page_z
|
|
|
|
+ if limit > int(cnt) {
|
|
|
|
+ limit = int(cnt)
|
|
|
|
+ }
|
|
r_jsons.Num = cnt
|
|
r_jsons.Num = cnt
|
|
r_jsons.RemainingTime = Attendance.GetRemainingDaysOff(T_uuid)
|
|
r_jsons.RemainingTime = Attendance.GetRemainingDaysOff(T_uuid)
|
|
- r_jsons.Data = attendance
|
|
|
|
|
|
+ r_jsons.Data = attendance[offset:limit]
|
|
r_jsons.Page = page
|
|
r_jsons.Page = page
|
|
r_jsons.Page_size = int(math.Ceil(float64(r_jsons.Num) / float64(page_z)))
|
|
r_jsons.Page_size = int(math.Ceil(float64(r_jsons.Num) / float64(page_z)))
|
|
|
|
|