|
|
@ -50,9 +50,8 @@ class CourseService extends BaseApiService |
|
|
$query->select(); |
|
|
$query->select(); |
|
|
},'venue' => function($query) { |
|
|
},'venue' => function($query) { |
|
|
$query->select(); |
|
|
$query->select(); |
|
|
}]); |
|
|
},'campus','studentCourses']); |
|
|
$list = $this->pageQuery($search_model); |
|
|
$list = $this->pageQuery($search_model); |
|
|
$PersonCourseSchedule = new PersonCourseSchedule(); |
|
|
|
|
|
foreach ($list['data'] as $k => $v) { |
|
|
foreach ($list['data'] as $k => $v) { |
|
|
$student = Db::name('person_course_schedule') |
|
|
$student = Db::name('person_course_schedule') |
|
|
->alias('pcs') |
|
|
->alias('pcs') |
|
|
@ -93,7 +92,7 @@ class CourseService extends BaseApiService |
|
|
->alias('sc') |
|
|
->alias('sc') |
|
|
->where('sc.course_id', $list['id']) |
|
|
->where('sc.course_id', $list['id']) |
|
|
->join('school_student_course_usage sscu', 'sc.id = sscu.student_course_id') |
|
|
->join('school_student_course_usage sscu', 'sc.id = sscu.student_course_id') |
|
|
->field('sc.student_id,sc.end_date') |
|
|
->field('sc.student_id,sc.end_date,sc.end_date,sc.start_date,sc.course_id') |
|
|
->select()->toArray(); |
|
|
->select()->toArray(); |
|
|
foreach ($student_courses as &$v){ |
|
|
foreach ($student_courses as &$v){ |
|
|
$student = Db::name('student') |
|
|
$student = Db::name('student') |
|
|
@ -138,6 +137,44 @@ class CourseService extends BaseApiService |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function classList($data) |
|
|
|
|
|
{ |
|
|
|
|
|
$CourseSchedule = new CourseSchedule(); |
|
|
|
|
|
$search_model = $CourseSchedule |
|
|
|
|
|
->where('coach_id', $data) |
|
|
|
|
|
->with(['course' => function($query) { |
|
|
|
|
|
$query->with(['studentCourses' => function($query) { |
|
|
|
|
|
$query->select(); |
|
|
|
|
|
}]); |
|
|
|
|
|
},'venue' => function($query) { |
|
|
|
|
|
$query->select(); |
|
|
|
|
|
},'coach' => function($query) { |
|
|
|
|
|
$query->select(); |
|
|
|
|
|
},'campus']); |
|
|
|
|
|
$list = $this->pageQuery($search_model); |
|
|
|
|
|
foreach ($list['data'] as &$v){ |
|
|
|
|
|
$student = Db::name('person_course_schedule') |
|
|
|
|
|
->alias('pcs') |
|
|
|
|
|
->where('pcs.schedule_id', $v['id']) |
|
|
|
|
|
->join('school_student st', 'pcs.student_id = st.id') |
|
|
|
|
|
->join('school_customer_resources cr', 'st.user_id = cr.id') |
|
|
|
|
|
->join('school_member sm', 'cr.member_id = sm.member_id') |
|
|
|
|
|
->field('st.name, sm.headimg as avatar') |
|
|
|
|
|
->select(); |
|
|
|
|
|
$v['student'] = $student; |
|
|
|
|
|
} |
|
|
|
|
|
foreach ($list['data'] as &$v) { |
|
|
|
|
|
$student_courses = Db::name('student_courses') |
|
|
|
|
|
->alias('sc') |
|
|
|
|
|
->where('sc.course_id', $v['id']) |
|
|
|
|
|
->join('school_student_course_usage sscu', 'sc.id = sscu.student_course_id') |
|
|
|
|
|
->field('sc.student_id,sc.end_date,sc.end_date,sc.start_date,sc.course_id') |
|
|
|
|
|
->select()->toArray(); |
|
|
|
|
|
$v['student_courses'] = $student_courses; |
|
|
|
|
|
} |
|
|
|
|
|
return $list; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//获取添加学员列表 |
|
|
//获取添加学员列表 |
|
|
public function StudentList($id) |
|
|
public function StudentList($id) |
|
|
{ |
|
|
{ |
|
|
|