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

修改志愿者列表

@@ -77,32 +77,58 @@ class VolunteerModel extends Model @@ -77,32 +77,58 @@ class VolunteerModel extends Model
77 $userInfo['study_time']=$user['study_time']; 77 $userInfo['study_time']=$user['study_time'];
78 $userInfo['use_time']=$user['use_time']??0; 78 $userInfo['use_time']=$user['use_time']??0;
79 $userInfo['level_time']=$user['work_time']-$user['use_time']; 79 $userInfo['level_time']=$user['work_time']-$user['use_time'];
80 - if ($user['status']==2){  
81 - if ($user['study_time']>=5 && $user['work_time']>10){  
82 - $userInfo['status']='志愿者';  
83 - $userInfo['user_num']=$userId.$user['create_time'];  
84 - } 80 + $userInfo['status']=$this->getUserState($user['status'],$user['stage']);
  81 +// if ($user['status']==2){
  82 +// if ($user['study_time']>=5 && $user['work_time']>10){
  83 +// $userInfo['status']='志愿者';
  84 +// $userInfo['user_num']=$userId.$user['create_time'];
  85 +// }
  86 +//
  87 +// if ($user['study_time']<5){
  88 +// $userInfo['status']='志愿者(待学习)';
  89 +// $userInfo['user_num']='';
  90 +// }
  91 +//
  92 +// if ($user['study_time']>=5 && $user['work_time']<10){
  93 +// $userInfo['status']='志愿者(待实习)';
  94 +// $userInfo['user_num']='';
  95 +// }
  96 +// }else{
  97 +// $userInfo['status']='非志愿者';
  98 +// $userInfo['user_num']='';
  99 +// }
85 100
86 - if ($user['study_time']<5){  
87 - $userInfo['status']='志愿者(待学习)';  
88 - $userInfo['user_num']='';  
89 - } 101 + return $userInfo;
90 102
91 - if ($user['study_time']>=5 && $user['work_time']<10){  
92 - $userInfo['status']='志愿者(待实习)';  
93 - $userInfo['user_num']=''; 103 + }
  104 +
  105 + public function getUserState($status,$stage){
  106 + $name='';
  107 + if ($status==2){
  108 + switch ($stage){
  109 +
  110 + case 1:
  111 + $name='志愿者(待学习)';
  112 + break;
  113 + case 2:
  114 + $name='志愿者(待实习)';
  115 + break;
  116 + case 3:
  117 + $name='志愿者';
  118 + break;
  119 + default:
  120 + $name='';
  121 + break;
94 } 122 }
95 }else{ 123 }else{
96 - $userInfo['status']='非志愿者';  
97 - $userInfo['user_num']=''; 124 + $name='非志愿者';
98 } 125 }
  126 + return $name;
  127 + }
99 128
100 129
101 - return $userInfo;  
102 -  
103 - }  
104 130
105 - /** 131 + /*
106 * 获取用户状态 132 * 获取用户状态
107 * @param $userId 133 * @param $userId
108 * @return mixed 134 * @return mixed
@@ -122,27 +148,46 @@ class VolunteerModel extends Model @@ -122,27 +148,46 @@ class VolunteerModel extends Model
122 $return['remark']='审核中'; 148 $return['remark']='审核中';
123 } 149 }
124 if ($user['status']==2){ 150 if ($user['status']==2){
125 - if ($user['study_time']>=5 && $user['work_time']>10){  
126 - $userInfo['status']='志愿者';  
127 - $userInfo['user_num']=$userId.$user['create_time'];  
128 - $return['code']=4;  
129 - $return['remark']='志愿者';  
130 - }  
131 -  
132 - if ($user['study_time']<5){  
133 - $userInfo['status']='志愿者(待学习)';  
134 - $userInfo['user_num']='';  
135 - $return['code']=2;  
136 - $return['remark']='志愿者(待学习)';  
137 - }  
138 -  
139 - if ($user['study_time']>=5 && $user['work_time']<10){  
140 - $userInfo['status']='志愿者(待实习)';  
141 - $userInfo['user_num']='';  
142 -  
143 - $return['code']=3;  
144 - $return['remark']='志愿者(待实习)'; 151 + switch ($user['stage']){
  152 + case 1:
  153 + $return['code']=2;
  154 + $return['remark']='志愿者(待学习)';
  155 + break;
  156 + case 2:
  157 + $return['code']=3;
  158 + $return['remark']='志愿者(待实习)';
  159 + break;
  160 + case 3:
  161 + $return['code']=4;
  162 + $return['remark']='志愿者';
  163 + break;
  164 + default:
  165 + $return['code']='';
  166 + $return['remark']='';
  167 + break;
145 } 168 }
  169 +// $this->getUserStage()
  170 +// if ($user['study_time']>=5 && $user['work_time']>10){
  171 +// $userInfo['status']='志愿者';
  172 +// $userInfo['user_num']=$userId.$user['create_time'];
  173 +// $return['code']=4;
  174 +// $return['remark']='志愿者';
  175 +// }
  176 +//
  177 +// if ($user['study_time']<5){
  178 +// $userInfo['status']='志愿者(待学习)';
  179 +// $userInfo['user_num']='';
  180 +// $return['code']=2;
  181 +// $return['remark']='志愿者(待学习)';
  182 +// }
  183 +//
  184 +// if ($user['study_time']>=5 && $user['work_time']<10){
  185 +// $userInfo['status']='志愿者(待实习)';
  186 +// $userInfo['user_num']='';
  187 +//
  188 +// $return['code']=3;
  189 +// $return['remark']='志愿者(待实习)';
  190 +// }
146 } 191 }
147 if ($user['status']==3){ 192 if ($user['status']==3){
148 $return['code']=-1; 193 $return['code']=-1;
@@ -1003,7 +1003,7 @@ class SecondController extends RestBaseController @@ -1003,7 +1003,7 @@ class SecondController extends RestBaseController
1003 $font='../static/font-awesome/fonts/PingFang Medium.ttf'; 1003 $font='../static/font-awesome/fonts/PingFang Medium.ttf';
1004 $text1='姓名 '.$userInfo['name']; 1004 $text1='姓名 '.$userInfo['name'];
1005 $text2='身份 '.$userInfo['status']; 1005 $text2='身份 '.$userInfo['status'];
1006 - $text3='编号 '.$userInfo['user_num']; 1006 + $text3='编号 '.$userInfo['zhengJianInfouser_num'];
1007 $text4='当前学时 '.$userInfo['work_time'].'小时'; 1007 $text4='当前学时 '.$userInfo['work_time'].'小时';
1008 $locate1[]='35'; 1008 $locate1[]='35';
1009 $locate1[]='100'; 1009 $locate1[]='100';