...
|
...
|
@@ -16,7 +16,7 @@ use think\Validate; |
|
|
*/
|
|
|
class Lists extends Api
|
|
|
{
|
|
|
protected $noNeedLogin = ['get_list','type_title','type_list','ke_list','index','policy','download','index_info','policy_info','download_info','video_list','video_detail','study','password_login','find_pwd','ke_list_detail','getcode','verify'];
|
|
|
protected $noNeedLogin = ['get_list','type_title','type_list','ke_list','index','sou','policy','download','index_info','policy_info','download_info','video_list','video_detail','study','password_login','find_pwd','ke_list_detail','getcode','verify'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -83,7 +83,7 @@ class Lists extends Api |
|
|
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
|
|
|
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
|
|
|
* @ApiParams (name="keyword", type="string", required=false, description="搜索关键字")
|
|
|
* @ApiParams (name="type", type="inter", required=false, description="类型1通知公告2优选课程3培训课程")
|
|
|
* @ApiParams (name="type", type="inter", required=false, description="类型1通知公告2优选课程3培训课程4政策动态5下载专区")
|
|
|
* @ApiParams (name="id", type="inter", required=false, description="学习系统id")
|
|
|
*
|
|
|
* @ApiReturn({
|
...
|
...
|
@@ -151,6 +151,9 @@ class Lists extends Api |
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}elseif ($type == 3){
|
|
|
if(!$this->auth->isLogin()){
|
|
|
$this->error(__('Please login first'), null, 401);
|
|
|
}
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('学习系统id不能为空');
|
...
|
...
|
@@ -171,6 +174,36 @@ class Lists extends Api |
|
|
$v['video_image'] = $this->get_video_first_image( $v['video_file'], $video_info);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}elseif ($type == 4){
|
|
|
$data['total_num'] = Db::name('policy')
|
|
|
->where('title','like',"%$keyword%")
|
|
|
->count();
|
|
|
|
|
|
$data['info'] = Db::name('policy')
|
|
|
->field('id,title,is_up,desc,createtime')
|
|
|
->where('title','like',"%$keyword%")
|
|
|
->order('is_up desc,createtime desc')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
foreach ($data['info'] as &$v){
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}elseif ($type == 5){
|
|
|
$data['total_num'] = Db::name('download')
|
|
|
->where('title','like',"%$keyword%")
|
|
|
->count();
|
|
|
|
|
|
$data['info'] = Db::name('download')
|
|
|
->field('id,title,is_up,desc,createtime')
|
|
|
->where('title','like',"%$keyword%")
|
|
|
->order('is_up desc,createtime desc')
|
|
|
->page($page,$pageNum)
|
|
|
->select();
|
|
|
foreach ($data['info'] as &$v){
|
|
|
$v['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
|
|
|
}
|
|
|
$this->success('success',$data);
|
|
|
}else{
|
|
|
$this->error('类型错误');
|
|
|
}
|
...
|
...
|
|