...
|
...
|
@@ -128,8 +128,7 @@ class Course extends Api |
|
|
"video": { //一节课视频地址
|
|
|
"cover": "http://www.enterprise.top/assets/img/bg-middle.jpg", //视频封面
|
|
|
"video": "https://vd2.bdstatic.com/mda-jkptk0q9euab5v41/sc/mda-jkptk0q9euab5v41.mp4?auth_key=1599909914-0-0-1b5b778ac7883d30cf78883ff8884b7e&bcevod_channel=searchbox_feed&pd=1&pt=3" //视频
|
|
|
},
|
|
|
"is_buy": 0 //是否已购买:0=否,1=是
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
*/
|
...
|
...
|
@@ -155,13 +154,6 @@ class Course extends Api |
|
|
$video = $catalog_child['video'];
|
|
|
}
|
|
|
$info['video'] = $video;
|
|
|
// 是否已购买
|
|
|
$order = CourseOrder::where('user_id',$this->auth->id)
|
|
|
->where('course_id',$course_id)
|
|
|
->where('pay_status','1')
|
|
|
->field('id')
|
|
|
->find();
|
|
|
$info['is_buy'] = !empty($order) ? 1 : 0;
|
|
|
$this->success('成功',$info->visible([
|
|
|
'id',
|
|
|
'title',
|
...
|
...
|
@@ -169,8 +161,7 @@ class Course extends Api |
|
|
'current_price',
|
|
|
'original_price'
|
|
|
])->append([
|
|
|
'video',
|
|
|
'is_buy'
|
|
|
'video'
|
|
|
]));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -183,19 +174,25 @@ class Course extends Api |
|
|
* @ApiParams (name="course_id", type="int", required=true, description="课程ID")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1599908189",
|
|
|
"data": [{
|
|
|
"id": 1, //一级目录ID
|
|
|
"name": "第一章",
|
|
|
"childlist": [{ //二级目录列表
|
|
|
"id": 2, //二级目录ID
|
|
|
"name": "第一章-第一节", //二级目录名称
|
|
|
"video": "https://vd2.bdstatic.com/mda-jkptk0q9euab5v41/sc/mda-jkptk0q9euab5v41.mp4?auth_key=1599909914-0-0-1b5b778ac7883d30cf78883ff8884b7e&bcevod_channel=searchbox_feed&pd=1&pt=3" //视频地址
|
|
|
}]
|
|
|
}]
|
|
|
})
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1600927297",
|
|
|
"data": {
|
|
|
"is_buy": 0, //是否已购买:0=否,1=是
|
|
|
"list": [{
|
|
|
"id": 1, //一级目录ID
|
|
|
"name": "第一章", //一级目录名称
|
|
|
"childlist": [{ //二级目录列表
|
|
|
"id": 2, //二级目录ID
|
|
|
"name": "第一章-第一节", //二级目录名称
|
|
|
"video": { //视频信息
|
|
|
"cover": "http://www.enterprise.top/assets/img/bg-middle.jpg", //封面
|
|
|
"video": "https://vd2.bdstatic.com/mda-jkptk0q9euab5v41/sc/mda-jkptk0q9euab5v41.mp4?auth_key=1599909914-0-0-1b5b778ac7883d30cf78883ff8884b7e&bcevod_channel=searchbox_feed&pd=1&pt=3" //视频
|
|
|
}
|
|
|
}]
|
|
|
}]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function catalog()
|
|
|
{
|
...
|
...
|
@@ -218,7 +215,14 @@ class Course extends Api |
|
|
}
|
|
|
$v['childlist'] = $childlist;
|
|
|
}
|
|
|
$this->success('成功',$list);
|
|
|
// 是否已购买
|
|
|
$order = CourseOrder::where('user_id',$this->auth->id)
|
|
|
->where('course_id',$course_id)
|
|
|
->where('pay_status','1')
|
|
|
->field('id')
|
|
|
->find();
|
|
|
$is_buy = !empty($order) ? 1 : 0;
|
|
|
$this->success('成功',compact('is_buy','list'));
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -232,16 +236,12 @@ class Course extends Api |
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "成功",
|
|
|
"time": "1599908189",
|
|
|
"data": [{
|
|
|
"id": 1, //一级目录ID
|
|
|
"name": "第一章",
|
|
|
"childlist": [{ //二级目录列表
|
|
|
"id": 2, //二级目录ID
|
|
|
"name": "第一章-第一节", //二级目录名称
|
|
|
"video": "https://vd2.bdstatic.com/mda-jkptk0q9euab5v41/sc/mda-jkptk0q9euab5v41.mp4?auth_key=1599909914-0-0-1b5b778ac7883d30cf78883ff8884b7e&bcevod_channel=searchbox_feed&pd=1&pt=3" //视频地址
|
|
|
}]
|
|
|
}]
|
|
|
"time": "1600927509",
|
|
|
"data": {
|
|
|
"teacher_avatar": "/uploads/20200814/a8df375d64ec5f828a38ded72f42333e.jpg", //老师头像
|
|
|
"teacher_name": "杰克", //老师名称
|
|
|
"teacher_desc": "汤姆包与杰克鼠" //老师介绍
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function teacher()
|
...
|
...
|
|