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

修改志愿者列表

@@ -23,7 +23,9 @@ class VolunteerController extends AdminBaseController @@ -23,7 +23,9 @@ class VolunteerController extends AdminBaseController
23 $where = []; 23 $where = [];
24 $where1 = []; 24 $where1 = [];
25 $param = $this->request->param(); 25 $param = $this->request->param();
26 - 26 + if(!isset($param['stage'])){
  27 + $this->redirect('index',['stage'=>0]);
  28 + }
27 $startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']); 29 $startTime = empty($param['start_time']) ? 0 : strtotime($param['start_time']);
28 $endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']); 30 $endTime = empty($param['end_time']) ? 0 : strtotime($param['end_time']);
29 if (!empty($startTime) && !empty($endTime)) { 31 if (!empty($startTime) && !empty($endTime)) {
@@ -40,7 +42,7 @@ class VolunteerController extends AdminBaseController @@ -40,7 +42,7 @@ class VolunteerController extends AdminBaseController
40 if (!empty($category)) { 42 if (!empty($category)) {
41 $where['status'] = ['eq', "$category"]; 43 $where['status'] = ['eq', "$category"];
42 } 44 }
43 - 45 +
44 46
45 if (!empty($param['stage'])|| $param['stage']==0){ 47 if (!empty($param['stage'])|| $param['stage']==0){
46 switch ($param['stage']){ 48 switch ($param['stage']){
@@ -30,6 +30,13 @@ @@ -30,6 +30,13 @@
30 </td> 30 </td>
31 </tr> 31 </tr>
32 <tr> 32 <tr>
  33 + <th width="100">编号</th>
  34 + <td>
  35 + <input class="form-control" type="text" name="serial"
  36 + id="serial" value="{$data.serial}" placeholder="请输入编号" />
  37 + </td>
  38 + </tr>
  39 + <tr>
33 <th width="100">性别</th> 40 <th width="100">性别</th>
34 <td> 41 <td>
35 <label><input type="radio" name="sex" value="1" <if condition="$data.sex eq 1">checked</if> disabled/>男</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 42 <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 @@ @@ -146,8 +146,8 @@
146 </if> 146 </if>
147 </if> 147 </if>
148 148
149 - <if condition="$vo.status eq 1||$vo.status eq 4">  
150 - {:get_volunteer_status($work_time,$study_time)} 149 + <if condition="input('stage') eq 1| input('stage') eq 2">
  150 + {:get_volunteer_status($vo['work_time'],$vo['study_time'],$vo['status'])}
151 </if> 151 </if>
152 152
153 153
@@ -24,11 +24,42 @@ Route::any('plugin/[:_plugin]/[:_controller]/[:_action]', "\\cmf\\controller\\Pl @@ -24,11 +24,42 @@ Route::any('plugin/[:_plugin]/[:_controller]/[:_action]', "\\cmf\\controller\\Pl
24 Route::get('captcha/new', "\\cmf\\controller\\CaptchaController@index"); 24 Route::get('captcha/new', "\\cmf\\controller\\CaptchaController@index");
25 25
26 26
  27 +/**
  28 + * 获取志愿者状态
  29 + * @param $work_time
  30 + * @param $study_time
  31 + * @param $status
  32 + * @return string
  33 + */
  34 +function get_volunteer_status($work_time,$study_time,$status){
  35 +
  36 + if ($status==1){
  37 + $return['code']=1;
  38 + $return['remark']='审核中';
  39 + }
  40 + if ($status==2){
  41 + if ($study_time>=5 && $work_time>10){
  42 + $userInfo['status']='志愿者';
  43 + $return['code']=4;
  44 + $return['remark']='实习完成待审核';
  45 + }
27 46
  47 + if ($study_time<5){
  48 + $userInfo['status']='志愿者(待学习)';
  49 + $userInfo['user_num']='';
  50 + $return['code']=2;
  51 + $return['remark']='';
  52 + }
28 53
  54 + if ($study_time>=5 && $work_time<10){
  55 + $userInfo['status']='志愿者(待实习)';
  56 + $userInfo['user_num']='';
29 57
30 -function get_volunteer_status($work_time,$study_time){  
31 - 58 + $return['code']=3;
  59 + $return['remark']='学习完成待审核';
  60 + }
  61 + }
  62 + return $return['remark'];
32 } 63 }
33 /** 64 /**
34 * 获取当前登录的管理员ID 65 * 获取当前登录的管理员ID