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

修改志愿者列表

... ... @@ -77,32 +77,58 @@ class VolunteerModel extends Model
$userInfo['study_time']=$user['study_time'];
$userInfo['use_time']=$user['use_time']??0;
$userInfo['level_time']=$user['work_time']-$user['use_time'];
if ($user['status']==2){
if ($user['study_time']>=5 && $user['work_time']>10){
$userInfo['status']='志愿者';
$userInfo['user_num']=$userId.$user['create_time'];
}
$userInfo['status']=$this->getUserState($user['status'],$user['stage']);
// if ($user['status']==2){
// if ($user['study_time']>=5 && $user['work_time']>10){
// $userInfo['status']='志愿者';
// $userInfo['user_num']=$userId.$user['create_time'];
// }
//
// if ($user['study_time']<5){
// $userInfo['status']='志愿者(待学习)';
// $userInfo['user_num']='';
// }
//
// if ($user['study_time']>=5 && $user['work_time']<10){
// $userInfo['status']='志愿者(待实习)';
// $userInfo['user_num']='';
// }
// }else{
// $userInfo['status']='非志愿者';
// $userInfo['user_num']='';
// }
if ($user['study_time']<5){
$userInfo['status']='志愿者(待学习)';
$userInfo['user_num']='';
}
return $userInfo;
if ($user['study_time']>=5 && $user['work_time']<10){
$userInfo['status']='志愿者(待实习)';
$userInfo['user_num']='';
}
public function getUserState($status,$stage){
$name='';
if ($status==2){
switch ($stage){
case 1:
$name='志愿者(待学习)';
break;
case 2:
$name='志愿者(待实习)';
break;
case 3:
$name='志愿者';
break;
default:
$name='';
break;
}
}else{
$userInfo['status']='非志愿者';
$userInfo['user_num']='';
$name='非志愿者';
}
return $name;
}
return $userInfo;
}
/**
/*
* 获取用户状态
* @param $userId
* @return mixed
... ... @@ -122,27 +148,46 @@ class VolunteerModel extends Model
$return['remark']='审核中';
}
if ($user['status']==2){
if ($user['study_time']>=5 && $user['work_time']>10){
$userInfo['status']='志愿者';
$userInfo['user_num']=$userId.$user['create_time'];
$return['code']=4;
$return['remark']='志愿者';
}
if ($user['study_time']<5){
$userInfo['status']='志愿者(待学习)';
$userInfo['user_num']='';
$return['code']=2;
$return['remark']='志愿者(待学习)';
}
if ($user['study_time']>=5 && $user['work_time']<10){
$userInfo['status']='志愿者(待实习)';
$userInfo['user_num']='';
$return['code']=3;
$return['remark']='志愿者(待实习)';
switch ($user['stage']){
case 1:
$return['code']=2;
$return['remark']='志愿者(待学习)';
break;
case 2:
$return['code']=3;
$return['remark']='志愿者(待实习)';
break;
case 3:
$return['code']=4;
$return['remark']='志愿者';
break;
default:
$return['code']='';
$return['remark']='';
break;
}
// $this->getUserStage()
// if ($user['study_time']>=5 && $user['work_time']>10){
// $userInfo['status']='志愿者';
// $userInfo['user_num']=$userId.$user['create_time'];
// $return['code']=4;
// $return['remark']='志愿者';
// }
//
// if ($user['study_time']<5){
// $userInfo['status']='志愿者(待学习)';
// $userInfo['user_num']='';
// $return['code']=2;
// $return['remark']='志愿者(待学习)';
// }
//
// if ($user['study_time']>=5 && $user['work_time']<10){
// $userInfo['status']='志愿者(待实习)';
// $userInfo['user_num']='';
//
// $return['code']=3;
// $return['remark']='志愿者(待实习)';
// }
}
if ($user['status']==3){
$return['code']=-1;
... ...
... ... @@ -1003,7 +1003,7 @@ class SecondController extends RestBaseController
$font='../static/font-awesome/fonts/PingFang Medium.ttf';
$text1='姓名 '.$userInfo['name'];
$text2='身份 '.$userInfo['status'];
$text3='编号 '.$userInfo['user_num'];
$text3='编号 '.$userInfo['zhengJianInfouser_num'];
$text4='当前学时 '.$userInfo['work_time'].'小时';
$locate1[]='35';
$locate1[]='100';
... ...