45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\live;
|
|
|
|
use app\common\controller\Api;
|
|
|
|
/**
|
|
* 直播课件
|
|
*/
|
|
class Courseware extends Api
|
|
{
|
|
// 无需登录的接口,*表示全部
|
|
protected $noNeedLogin = [];
|
|
protected $noNeedRight = '*';
|
|
|
|
|
|
protected $modal;
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
$this->modal = new \app\api\model\live\Courseware;
|
|
}
|
|
|
|
/**
|
|
* 获取课件列表
|
|
* @return void
|
|
*/
|
|
public function getCoursewareList(){
|
|
$courseId = input('course_id');
|
|
|
|
//判断是否已订阅
|
|
if(!\app\common\model\user\Subscription::getSubscriptionAuth($this->auth->id,$courseId)){
|
|
$this->error("暂未订阅该课程");
|
|
}
|
|
|
|
$list = $this->modal->where([
|
|
'course_id'=>$courseId
|
|
])
|
|
->field(['file_type as filetype','file_name as filename','file_path as fullurl','file_size as filesize'])
|
|
->order("createtime",'desc')
|
|
->select();
|
|
|
|
$this->success("获取成功",$list);
|
|
}
|
|
} |