作者 王晓刚
1 个管道 的构建 通过 耗费 0 秒

海报

@@ -45,33 +45,24 @@ class ShareController extends WeChatBaseController @@ -45,33 +45,24 @@ class ShareController extends WeChatBaseController
45 if(!file_exists($savePath)){ 45 if(!file_exists($savePath)){
46 $prcode_url = $this->code_img($my_user['id'],$my_user['status']); 46 $prcode_url = $this->code_img($my_user['id'],$my_user['status']);
47 } 47 }
  48 + //保存头像
  49 + $avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']);
  50 + if($avatar['code']==1){
  51 + $this->error($avatar['msg']);
  52 + }
48 $savePath = './upload/poster'; 53 $savePath = './upload/poster';
49 if(!file_exists($savePath)){ 54 if(!file_exists($savePath)){
50 mkdir ($savePath,0777,true); 55 mkdir ($savePath,0777,true);
51 } 56 }
52 - if($user['status'] == 3){  
53 - //老师  
54 - $image = \think\Image::open(ROOT_PATH."public/white2.png");  
55 - $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)  
56 - ->water(ROOT_PATH."public/bg2.png",\think\Image::WATER_CENTER,100)  
57 - ->save('./upload/poster/poster_'.$user_id.".png");  
58 - }else{  
59 - //业务员  
60 - //保存头像  
61 - $avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']);  
62 - if($avatar['code']==1){  
63 - $this->error($avatar['msg']);  
64 - }  
65 - $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg");  
66 - $image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png");  
67 - $image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png");  
68 - $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.$my_user['status'].".png");  
69 - $image = \think\Image::open(ROOT_PATH."public/white.png");  
70 - $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)  
71 - ->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100)  
72 - ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100)  
73 - ->save('./upload/poster/poster_'.$user_id.".png");  
74 - } 57 + $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg");
  58 + $image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png");
  59 + $image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png");
  60 + $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.$my_user['status'].".png");
  61 + $image = \think\Image::open(ROOT_PATH."public/white.png");
  62 + $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)
  63 + ->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100)
  64 + ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100)
  65 + ->save('./upload/poster/poster_'.$user_id.".png");
75 // } 66 // }
76 $share_image = cmf_get_image_url('poster/poster_'.$user_id.".png"); 67 $share_image = cmf_get_image_url('poster/poster_'.$user_id.".png");
77 $this->assign('share_image',$share_image); 68 $this->assign('share_image',$share_image);