...
|
...
|
@@ -984,45 +984,51 @@ class SecondController extends RestBaseController |
|
|
*/
|
|
|
public function zhengJianPic(){
|
|
|
$userId=$this->getUserId();
|
|
|
$User=new VolunteerModel();
|
|
|
$user=$User->where('user_id',$userId)->find()->toArray();
|
|
|
//dump($user);
|
|
|
$userInfo=$User->getUserInfo($userId);
|
|
|
|
|
|
$path='../upload/zhengjian/';
|
|
|
$info['photo']=explode('https://volunteer.cnpu.org',$user['photo']);
|
|
|
$path1=ROOT_PATH.'public/imgs/font.png';
|
|
|
$path2=ROOT_PATH.'public'.DS.$info['photo'][1];
|
|
|
$image1 =\think\Image::open($path1);
|
|
|
$image2 =\think\Image::open($path2)
|
|
|
->thumb('225',310,\think\Image::THUMB_CENTER)->save(ROOT_PATH.'public/upload/user/'.$userId.'.png');
|
|
|
$photo='';
|
|
|
$photo_local[]=430;
|
|
|
$photo_local[]=62;
|
|
|
$font='../static/font-awesome/fonts/PingFang Medium.ttf';
|
|
|
$text1='姓名 '.$userInfo['name'];
|
|
|
$text2='身份 '.$userInfo['status'];
|
|
|
$text3='编号 '.$userInfo['user_num'];
|
|
|
$text4='当前学时 '.$userInfo['work_time'].'小时';
|
|
|
$locate1[]='35';
|
|
|
$locate1[]='100';
|
|
|
$locate2[]='35';
|
|
|
$locate2[]='165';
|
|
|
$locate3[]='35';
|
|
|
$locate3[]='235';
|
|
|
$locate4[]='35';
|
|
|
$locate4[]='300';
|
|
|
|
|
|
$image1
|
|
|
->water(ROOT_PATH.'public/upload/user/'.$userId.'.png',$photo_local)
|
|
|
->text($text1,$font,20,'#FFFFFF',$locate1)
|
|
|
->text($text2,$font,20,'#FFFFFF',$locate2)
|
|
|
->text($text3,$font,20,'#FFFFFF',$locate3)
|
|
|
->text($text4,$font,20,'#FFFFFF',$locate4)
|
|
|
->save($path.$userId.'.png');
|
|
|
//$image2->thumb(430,62);
|
|
|
$return['url']=cmf_get_image_url('/upload/zhengjian/'.$userId.'.png');
|
|
|
$this->success('',$return);
|
|
|
$type=input('type');
|
|
|
if ($type==1){
|
|
|
$User=new VolunteerModel();
|
|
|
$user=$User->where('user_id',$userId)->find()->toArray();
|
|
|
//dump($user);
|
|
|
$userInfo=$User->getUserInfo($userId);
|
|
|
|
|
|
$path='../upload/zhengjian/';
|
|
|
$info['photo']=explode('https://volunteer.cnpu.org',$user['photo']);
|
|
|
$path1=ROOT_PATH.'public/imgs/font.png';
|
|
|
$path2=ROOT_PATH.'public'.DS.$info['photo'][1];
|
|
|
$image1 =\think\Image::open($path1);
|
|
|
$image2 =\think\Image::open($path2)
|
|
|
->thumb('225',310,\think\Image::THUMB_CENTER)->save(ROOT_PATH.'public/upload/user/'.$userId.'.png');
|
|
|
$photo='';
|
|
|
$photo_local[]=430;
|
|
|
$photo_local[]=62;
|
|
|
$font='../static/font-awesome/fonts/PingFang Medium.ttf';
|
|
|
$text1='姓名 '.$userInfo['name'];
|
|
|
$text2='身份 '.$userInfo['status'];
|
|
|
$text3='编号 '.$userInfo['user_num'];
|
|
|
$text4='当前学时 '.$userInfo['work_time'].'小时';
|
|
|
$locate1[]='35';
|
|
|
$locate1[]='100';
|
|
|
$locate2[]='35';
|
|
|
$locate2[]='165';
|
|
|
$locate3[]='35';
|
|
|
$locate3[]='235';
|
|
|
$locate4[]='35';
|
|
|
$locate4[]='300';
|
|
|
|
|
|
$image1
|
|
|
->water(ROOT_PATH.'public/upload/user/'.$userId.'.png',$photo_local)
|
|
|
->text($text1,$font,20,'#FFFFFF',$locate1)
|
|
|
->text($text2,$font,20,'#FFFFFF',$locate2)
|
|
|
->text($text3,$font,20,'#FFFFFF',$locate3)
|
|
|
->text($text4,$font,20,'#FFFFFF',$locate4)
|
|
|
->save($path.$userId.'.png');
|
|
|
//$image2->thumb(430,62);
|
|
|
$return['url']=cmf_get_image_url('/upload/zhengjian/'.$userId.'.png');
|
|
|
$this->success('',$return);
|
|
|
}else{
|
|
|
$return['url']=cmf_get_image_url('/imgs/back.png');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
/**
|
|
|
* @title 他人主页
|
...
|
...
|
|