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

海报

... ... @@ -45,33 +45,24 @@ class ShareController extends WeChatBaseController
if(!file_exists($savePath)){
$prcode_url = $this->code_img($my_user['id'],$my_user['status']);
}
//保存头像
$avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']);
if($avatar['code']==1){
$this->error($avatar['msg']);
}
$savePath = './upload/poster';
if(!file_exists($savePath)){
mkdir ($savePath,0777,true);
}
if($user['status'] == 3){
//老师
$image = \think\Image::open(ROOT_PATH."public/white2.png");
$image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)
->water(ROOT_PATH."public/bg2.png",\think\Image::WATER_CENTER,100)
->save('./upload/poster/poster_'.$user_id.".png");
}else{
//业务员
//保存头像
$avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']);
if($avatar['code']==1){
$this->error($avatar['msg']);
}
$image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg");
$image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png");
$image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png");
$image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.$my_user['status'].".png");
$image = \think\Image::open(ROOT_PATH."public/white.png");
$image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)
->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100)
->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100)
->save('./upload/poster/poster_'.$user_id.".png");
}
$image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg");
$image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png");
$image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png");
$image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.$my_user['status'].".png");
$image = \think\Image::open(ROOT_PATH."public/white.png");
$image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100)
->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100)
->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100)
->save('./upload/poster/poster_'.$user_id.".png");
// }
$share_image = cmf_get_image_url('poster/poster_'.$user_id.".png");
$this->assign('share_image',$share_image);
... ...