diff --git a/niucloud/app/api/controller/apiController/PersonCourseSchedule.php b/niucloud/app/api/controller/apiController/PersonCourseSchedule.php index 514d3d5a..73ee558d 100644 --- a/niucloud/app/api/controller/apiController/PersonCourseSchedule.php +++ b/niucloud/app/api/controller/apiController/PersonCourseSchedule.php @@ -24,11 +24,14 @@ use function DI\string; class PersonCourseSchedule extends BaseApiService { - //列表 + //列表(人员与课程安排关系表) public function index(Request $request) { $resources_id = $request->param('resources_id', '');//客户资源ID $status = $request->param('status', '');//状态0待上课1已上课2请假 + $course_date = $request->param('course_date', '');//上课日期Y-m-d + $venue_id = $request->param('venue_id', '');//场地ID + if (empty($resources_id)) { return fail('缺少参数'); } @@ -36,6 +39,8 @@ class PersonCourseSchedule extends BaseApiService $where = [ 'resources_id' => $resources_id, 'status' => $status, + 'course_date' => $course_date, + 'venue_id' => $venue_id, ]; $res = (new PersonCourseScheduleService())->getList($where); diff --git a/niucloud/app/service/api/apiService/PersonCourseScheduleService.php b/niucloud/app/service/api/apiService/PersonCourseScheduleService.php index 3e223ddb..b54f70f0 100644 --- a/niucloud/app/service/api/apiService/PersonCourseScheduleService.php +++ b/niucloud/app/service/api/apiService/PersonCourseScheduleService.php @@ -42,9 +42,20 @@ class PersonCourseScheduleService extends BaseApiService $model = $model->where('resources_id', $where['resources_id']); } + //上课日期 + if (!empty($where['course_date'])) { + $model = $model->where('course_date', $where['course_date']); + } + //判断有没有客户上课状态 if (array_key_exists('status', $where) && $where['status'] != '') { - $model = $model->where('status', $where['status']); +// $model = $model->where('status', $where['status']); + $model = $model->where('school_person_course_schedule.status', $where['status']); + } + + // 判断有没有场地ID + if (!empty($where['venue_id'])) { + $model = $model->hasWhere('courseScheduleHasOne', ['venue_id' => $where['venue_id']]); } $data = $model->order('course_date','desc')