作者 sgj
1 个管道 的构建 失败 耗费 0 秒

修改志愿者列表

... ... @@ -23,7 +23,9 @@ class VolunteerController extends AdminBaseController
$where = [];
$where1 = [];
$param = $this->request->param();
if(!isset($param['stage'])){
$this->redirect('index',['stage'=>0]);
}
$startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
$endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
if (!empty($startTime) && !empty($endTime)) {
... ... @@ -40,7 +42,7 @@ class VolunteerController extends AdminBaseController
if (!empty($category)) {
$where['status'] = ['eq', "$category"];
}
if (!empty($param['stage'])|| $param['stage']==0){
switch ($param['stage']){
... ...
... ... @@ -30,6 +30,13 @@
</td>
</tr>
<tr>
<th width="100">编号</th>
<td>
<input class="form-control" type="text" name="serial"
id="serial" value="{$data.serial}" placeholder="请输入编号" />
</td>
</tr>
<tr>
<th width="100">性别</th>
<td>
<label><input type="radio" name="sex" value="1" <if condition="$data.sex eq 1">checked</if> disabled/>男</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
... ...
... ... @@ -146,8 +146,8 @@
</if>
</if>
<if condition="$vo.status eq 1||$vo.status eq 4">
{:get_volunteer_status($work_time,$study_time)}
<if condition="input('stage') eq 1| input('stage') eq 2">
{:get_volunteer_status($vo['work_time'],$vo['study_time'],$vo['status'])}
</if>
... ...
... ... @@ -24,11 +24,42 @@ Route::any('plugin/[:_plugin]/[:_controller]/[:_action]', "\\cmf\\controller\\Pl
Route::get('captcha/new', "\\cmf\\controller\\CaptchaController@index");
/**
* 获取志愿者状态
* @param $work_time
* @param $study_time
* @param $status
* @return string
*/
function get_volunteer_status($work_time,$study_time,$status){
if ($status==1){
$return['code']=1;
$return['remark']='审核中';
}
if ($status==2){
if ($study_time>=5 && $work_time>10){
$userInfo['status']='志愿者';
$return['code']=4;
$return['remark']='实习完成待审核';
}
if ($study_time<5){
$userInfo['status']='志愿者(待学习)';
$userInfo['user_num']='';
$return['code']=2;
$return['remark']='';
}
if ($study_time>=5 && $work_time<10){
$userInfo['status']='志愿者(待实习)';
$userInfo['user_num']='';
function get_volunteer_status($work_time,$study_time){
$return['code']=3;
$return['remark']='学习完成待审核';
}
}
return $return['remark'];
}
/**
* 获取当前登录的管理员ID
... ...