From 44ba7415523d2e4cbcf96d0306812ddcada3b271 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Wed, 24 Jan 2024 10:47:03 +0800 Subject: [PATCH] update --- .../lists/project/ProjectAttendanceRecordLists.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/adminapi/lists/project/ProjectAttendanceRecordLists.php b/app/adminapi/lists/project/ProjectAttendanceRecordLists.php index 28eb1ae97..e3e320f5f 100644 --- a/app/adminapi/lists/project/ProjectAttendanceRecordLists.php +++ b/app/adminapi/lists/project/ProjectAttendanceRecordLists.php @@ -65,12 +65,13 @@ class ProjectAttendanceRecordLists extends BaseAdminDataLists implements ListsSe $project = Project::field('name,project_code')->where('id',$item['project_id'])->findOrEmpty(); $item['project_name'] = $project['name']; $item['project_code'] = $project['project_code']; - $item['work_record_num_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('work_record_num'); - $item['daily_salary_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('daily_salary'); - $item['daily_living_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('daily_living'); - $item['daily_subsidy_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('daily_subsidy'); - $item['daily_other_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('daily_other'); - $item['daily_income_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->sum('daily_income'); + $item['work_record_num_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('work_record_num'); + $item['daily_salary_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('daily_salary'); + $item['daily_living_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('daily_living'); + $item['daily_subsidy_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('daily_subsidy'); + $item['daily_other_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('daily_other'); + $item['daily_income_total'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->sum('daily_income'); + $item['cqrs'] = ProjectAttendanceDetail::field('id')->where('attendance_id',$item['id'])->where('attendance_date',$item['attendance_date'])->count(); return $item; }) ->toArray();