...
|
...
|
@@ -207,6 +207,50 @@ class SecondController extends RestBaseController |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 我的培训列表(new)
|
|
|
* @description 我的培训列表
|
|
|
* @author sgj
|
|
|
* @url /index/second/myTrain
|
|
|
* @method GET
|
|
|
*
|
|
|
*@header name:XX-Token require:1 default: desc:token
|
|
|
*
|
|
|
*
|
|
|
* @return id:文章id
|
|
|
* @return pic:图片
|
|
|
* @return num:题目数量
|
|
|
* @return author:作者
|
|
|
* @return content:内容
|
|
|
* @return user_status:用户状态0,未完成1,已完成
|
|
|
* @return author:作者
|
|
|
*
|
|
|
* @throws
|
|
|
*/
|
|
|
public function myTrain(){
|
|
|
$userId=$this->getUserId();
|
|
|
$map1['user_id']=$userId;
|
|
|
$pass_array=db('user_pass')->where($map1)->column('class_id');
|
|
|
if (empty($pass_array)){
|
|
|
$pass_array=[];
|
|
|
}
|
|
|
$Class=new ClassModel();
|
|
|
$map['status']=1;
|
|
|
$list=$Class->where($map)->order('weight desc')->paginate('10');
|
|
|
$data=$list->items();
|
|
|
|
|
|
foreach ($data as $k=>$v) {
|
|
|
if (in_array($v['id'],$pass_array)){
|
|
|
$data[$k]['user_status']=1;
|
|
|
}else{
|
|
|
$data[$k]['user_status']=0;
|
|
|
}
|
|
|
$data[$k]['pic']=cmf_get_image_url($v['pic']);
|
|
|
}
|
|
|
|
|
|
$this->success('',$list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 检查志愿者状态
|
|
|
* @description 检查志愿者状态
|
|
|
* @author sgj
|
...
|
...
|
|