作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

PC搜索

... ... @@ -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('类型错误');
}
... ...
... ... @@ -4813,7 +4813,7 @@
<td>type</td>
<td>inter</td>
<td></td>
<td>类型1通知公告2优选课程3培训课程</td>
<td>类型1通知公告2优选课程3培训课程4政策动态5下载专区</td>
</tr>
<tr>
<td>id</td>
... ... @@ -4853,7 +4853,7 @@
</div>
<div class="form-group">
<label class="control-label" for="type">type</label>
<input type="inter" class="form-control input-sm" id="type" placeholder="类型1通知公告2优选课程3培训课程" name="type">
<input type="inter" class="form-control input-sm" id="type" placeholder="类型1通知公告2优选课程3培训课程4政策动态5下载专区" name="type">
</div>
<div class="form-group">
<label class="control-label" for="id">id</label>
... ... @@ -7900,7 +7900,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2021-01-27 10:11:48 </div>
Generated on 2021-01-27 17:20:14 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">企智帮</a>
</div>
... ...