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

服务器配置

... ... @@ -39,12 +39,12 @@ class ShareController extends WeChatBaseController
//判断有没有生成过
// if(!file_exists('./upload/poster/poster_'.$user_id.".png")){
$url = $this->get_url($my_user['id'],$my_user['status']);
$webPath = 'qrcode/code_img'.$user_id.'.png';
$webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png';
$savePath = './upload/'.$webPath;
//生成带参二维码
// if(!file_exists($savePath)){
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){
... ... @@ -56,10 +56,10 @@ class ShareController extends WeChatBaseController
}
$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.".png");
$image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$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.".png",[195,725],100)
$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");
... ... @@ -95,7 +95,7 @@ class ShareController extends WeChatBaseController
$this->error('无权限','','','');
}
$url = $this->get_url($my_user['id'],$my_user['status']);
$webPath = 'qrcode/code_img'.$user_id.'.png';
$webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png';
$savePath = './upload/'.$webPath;
//生成带参二维码
if(!file_exists($savePath)){
... ... @@ -112,10 +112,10 @@ class ShareController extends WeChatBaseController
}
$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.".png");
$image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$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.".png",[195,725],100)
$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");
... ... @@ -196,8 +196,8 @@ class ShareController extends WeChatBaseController
$code_img = $this->code_img1($my_user_id,$status);
$code = file_get_contents($code_img);
$user_id = Db::name('my_user')->where('id',$my_user_id)->value('uid');
file_put_contents(ROOT_PATH."public/upload/qrcode/code_img$user_id.png",$code);
return $savePath."code_img$user_id.png";
file_put_contents(ROOT_PATH."public/upload/qrcode/code_img$user_id$status.png",$code);
return $savePath."code_img$user_id$status.png";
}
/**
... ...