...
|
...
|
@@ -15,6 +15,7 @@ use api\common\model\ClassQuestionModel; |
|
|
use api\common\model\LevelModel;
|
|
|
use api\common\model\NewsTypeMode;
|
|
|
use api\common\model\TeamModel;
|
|
|
use api\common\model\UserPassModel;
|
|
|
use api\common\model\VolunteerModel;
|
|
|
use cmf\controller\RestBaseController;
|
|
|
use think\console\output\formatter\Style;
|
...
|
...
|
@@ -302,13 +303,69 @@ class SecondController extends RestBaseController |
|
|
/*添加用户时长*/
|
|
|
$volunteer=new VolunteerModel();
|
|
|
$volunteer->where('user_id',$user_id)->setInc('work_time',$question['work_time']);
|
|
|
$volunteer->addWorkTime($user_id,$question['work_time']);
|
|
|
/*添加到完成*/
|
|
|
|
|
|
$this->success('回答成功');
|
|
|
$UserPassModel=new UserPassModel();
|
|
|
$UserPassModel->pass($user_id,$class_id);
|
|
|
$return['time']=$question['work_time'];
|
|
|
$this->success('回答成功',$return);
|
|
|
}else{
|
|
|
$this->error('问题回答错误');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @title 团队列表
|
|
|
* @description 团队列表
|
|
|
* @author sgj
|
|
|
* @url /index/second/teamList
|
|
|
* @method GET
|
|
|
*
|
|
|
*
|
|
|
*@header name:XX-Token require:1 default: desc:token
|
|
|
*
|
|
|
*@param name:city type:int require:1 other: desc:城市名称
|
|
|
*
|
|
|
* @throws
|
|
|
*/
|
|
|
public function teamList(){
|
|
|
$city=input('city');
|
|
|
$Team=new TeamModel();
|
|
|
$map['status']=2;
|
|
|
$team=$Team->where('city',$city)->where($map)->select();
|
|
|
if (!empty($team)){
|
|
|
foreach ($team as $k=>$v) {
|
|
|
$return['id']=$v['id'];
|
|
|
$return['name']=$v['name'];
|
|
|
$return['create_time']=date('Y-m-d',$v['create_time']);
|
|
|
$return['work_total_time']=$v['work_total_time'];
|
|
|
$return['people_num']=$v['people_num'];
|
|
|
$return['pic']=cmf_get_image_url($return['pic']);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 团队详情
|
|
|
* @description 团队详情
|
|
|
* @author sgj
|
|
|
* @url /index/second/teamInfo
|
|
|
* @method GET
|
|
|
*
|
|
|
*
|
|
|
*@header name:XX-Token require:1 default: desc:token
|
|
|
*
|
|
|
*@param name:city type:int require:1 other: desc:城市名称
|
|
|
*
|
|
|
* @throws
|
|
|
*/
|
|
|
public function teamInfo(){
|
|
|
$id=input('id');
|
|
|
$Team=new TeamModel();
|
|
|
$Team->getTeamInfo($id);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|