正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
@@ -39,12 +39,12 @@ class ShareController extends WeChatBaseController | @@ -39,12 +39,12 @@ class ShareController extends WeChatBaseController | ||
39 | //判断有没有生成过 | 39 | //判断有没有生成过 |
40 | // if(!file_exists('./upload/poster/poster_'.$user_id.".png")){ | 40 | // if(!file_exists('./upload/poster/poster_'.$user_id.".png")){ |
41 | $url = $this->get_url($my_user['id'],$my_user['status']); | 41 | $url = $this->get_url($my_user['id'],$my_user['status']); |
42 | - $webPath = 'qrcode/code_img'.$user_id.'.png'; | 42 | + $webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png'; |
43 | $savePath = './upload/'.$webPath; | 43 | $savePath = './upload/'.$webPath; |
44 | //生成带参二维码 | 44 | //生成带参二维码 |
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 | //保存头像 | 48 | //保存头像 |
49 | $avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']); | 49 | $avatar=$this->getImage($user['avatar'],'avatar_'.$user['id']); |
50 | if($avatar['code']==1){ | 50 | if($avatar['code']==1){ |
@@ -56,10 +56,10 @@ class ShareController extends WeChatBaseController | @@ -56,10 +56,10 @@ class ShareController extends WeChatBaseController | ||
56 | } | 56 | } |
57 | $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg"); | 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"); | 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.".png"); | ||
60 | - $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$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"); | 61 | $image = \think\Image::open(ROOT_PATH."public/white.png"); |
62 | - $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.".png",[195,725],100) | 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) | 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) | 64 | ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100) |
65 | ->save('./upload/poster/poster_'.$user_id.".png"); | 65 | ->save('./upload/poster/poster_'.$user_id.".png"); |
@@ -95,7 +95,7 @@ class ShareController extends WeChatBaseController | @@ -95,7 +95,7 @@ class ShareController extends WeChatBaseController | ||
95 | $this->error('无权限','','',''); | 95 | $this->error('无权限','','',''); |
96 | } | 96 | } |
97 | $url = $this->get_url($my_user['id'],$my_user['status']); | 97 | $url = $this->get_url($my_user['id'],$my_user['status']); |
98 | - $webPath = 'qrcode/code_img'.$user_id.'.png'; | 98 | + $webPath = 'qrcode/code_img'.$user_id.$my_user['status'].'.png'; |
99 | $savePath = './upload/'.$webPath; | 99 | $savePath = './upload/'.$webPath; |
100 | //生成带参二维码 | 100 | //生成带参二维码 |
101 | if(!file_exists($savePath)){ | 101 | if(!file_exists($savePath)){ |
@@ -112,10 +112,10 @@ class ShareController extends WeChatBaseController | @@ -112,10 +112,10 @@ class ShareController extends WeChatBaseController | ||
112 | } | 112 | } |
113 | $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg"); | 113 | $image = \think\Image::open(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".jpeg"); |
114 | $image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png"); | 114 | $image->thumb(173,173,\think\Image::THUMB_FIXED)->save('./upload/avatar/avatar_'.$user_id.".png"); |
115 | - $image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.".png"); | ||
116 | - $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img'.$user_id.".png"); | 115 | + $image = \think\Image::open(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png"); |
116 | + $image->thumb(360,360,\think\Image::THUMB_FIXED)->save('./upload/qrcode/code_img/'.$user_id.$my_user['status'].".png"); | ||
117 | $image = \think\Image::open(ROOT_PATH."public/white.png"); | 117 | $image = \think\Image::open(ROOT_PATH."public/white.png"); |
118 | - $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.".png",[195,725],100) | 118 | + $image->water(ROOT_PATH."public/upload/qrcode/code_img".$user_id.$my_user['status'].".png",[195,725],100) |
119 | ->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100) | 119 | ->water(ROOT_PATH."public/upload/avatar/avatar_".$user_id.".png",[289,478],100) |
120 | ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100) | 120 | ->water(ROOT_PATH."public/bg.png",\think\Image::WATER_CENTER,100) |
121 | ->save('./upload/poster/poster_'.$user_id.".png"); | 121 | ->save('./upload/poster/poster_'.$user_id.".png"); |
@@ -196,8 +196,8 @@ class ShareController extends WeChatBaseController | @@ -196,8 +196,8 @@ class ShareController extends WeChatBaseController | ||
196 | $code_img = $this->code_img1($my_user_id,$status); | 196 | $code_img = $this->code_img1($my_user_id,$status); |
197 | $code = file_get_contents($code_img); | 197 | $code = file_get_contents($code_img); |
198 | $user_id = Db::name('my_user')->where('id',$my_user_id)->value('uid'); | 198 | $user_id = Db::name('my_user')->where('id',$my_user_id)->value('uid'); |
199 | - file_put_contents(ROOT_PATH."public/upload/qrcode/code_img$user_id.png",$code); | ||
200 | - return $savePath."code_img$user_id.png"; | 199 | + file_put_contents(ROOT_PATH."public/upload/qrcode/code_img$user_id$status.png",$code); |
200 | + return $savePath."code_img$user_id$status.png"; | ||
201 | } | 201 | } |
202 | 202 | ||
203 | /** | 203 | /** |
-
请 注册 或 登录 后发表评论