|
@@ -151,27 +151,30 @@ class Lesson extends Api
|
|
|
$cate_id = input('cate_id',0);
|
|
|
$coach_id = input('coach_id',0);
|
|
|
|
|
|
+ //所有课程点进来的 额外传参
|
|
|
+ $lesson_id = input('lesson_id',0);
|
|
|
+
|
|
|
$where = [
|
|
|
'slot.starttime' => ['BETWEEN',[$date,$date+86399]],
|
|
|
'slot.status' => 0,
|
|
|
'slot.is_show' => 1,
|
|
|
];
|
|
|
- if($cate_id){
|
|
|
- $where['lesson.lessoncate_id'] = $cate_id;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
//课时
|
|
|
$list = Db::name('lesson_slot')->alias('slot')
|
|
|
->field('slot.*,lesson.name,lesson.name_en,lesson.image,lesson.price')
|
|
|
->join('lesson','slot.lesson_id = lesson.id','LEFT')
|
|
|
->where($where);
|
|
|
- if($coach_id){
|
|
|
- $list->where('find_in_set(:coach_ids,coach_ids)', ['coach_ids' => $coach_id]);
|
|
|
- }
|
|
|
- //所有课程点进来的 额外传参
|
|
|
- $lesson_id = input('lesson_id',0);
|
|
|
if($lesson_id){
|
|
|
$list->where('slot.lesson_id',$lesson_id);
|
|
|
+ }else{
|
|
|
+ if($cate_id){
|
|
|
+ $list->where('lesson.lessoncate_id',$cate_id);
|
|
|
+ }
|
|
|
+ if($coach_id){
|
|
|
+ $list->where('find_in_set(:coach_ids,coach_ids)', ['coach_ids' => $coach_id]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$list = $list->order('slot.starttime asc')->select();
|