作者 郭宇鹏
1 个管道 的构建 失败 耗费 0 秒

'12-31'

@@ -134,11 +134,11 @@ class Treasured extends BaseApi @@ -134,11 +134,11 @@ class Treasured extends BaseApi
134 ->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码 134 ->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码
135 ->logo($this->auth->avatar)//生成logo二维码 135 ->logo($this->auth->avatar)//生成logo二维码
136 ->getPath();//获取二维码生成的地址 136 ->getPath();//获取二维码生成的地址
137 - $code = new QRcode(); 137 +// $code = new QRcode();
138 $qr_code_d = $code->png($url.$treasured['id']) //生成二维码 138 $qr_code_d = $code->png($url.$treasured['id']) //生成二维码
139 ->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码 139 ->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码
140 ->logo($this->auth->avatar)//生成logo二维码 140 ->logo($this->auth->avatar)//生成logo二维码
141 - ->background(600,1020,cdnurl($qr_code_bg['value'])) //给二维码加上背景 141 + ->background(550,950,cdnurl($qr_code_bg['value'])) //给二维码加上背景
142 ->getPath();//获取二维码生成的地址 142 ->getPath();//获取二维码生成的地址
143 // $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97); 143 // $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97);
144 // $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97,cdnurl($qr_code_bg['value'])); 144 // $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97,cdnurl($qr_code_bg['value']));
@@ -32,5 +32,5 @@ return [ @@ -32,5 +32,5 @@ return [
32 'mail_smtp_pass' => 'password', 32 'mail_smtp_pass' => 'password',
33 'mail_verify_type' => '2', 33 'mail_verify_type' => '2',
34 'mail_from' => '10000@qq.com', 34 'mail_from' => '10000@qq.com',
35 - 'qr_code_bg' => '/uploads/20201231/b7e5d8935e6702eb5c66d28de31a56a1.png', 35 + 'qr_code_bg' => '/uploads/20201231/93347da98b4444cff5dc713bf2c9b00d.png',
36 ]; 36 ];
@@ -152,10 +152,11 @@ class QRcode @@ -152,10 +152,11 @@ class QRcode
152 152
153 //获取覆盖图图片的宽高 153 //获取覆盖图图片的宽高
154 list($src_w, $src_h) = getimagesize($src_path); 154 list($src_w, $src_h) = getimagesize($src_path);
155 - 155 + $a = getimagesize($dst_path);
  156 + $b = getimagesize($src_path);
156 157
157 //将覆盖图复制到目标图片上,最后个参数100是设置透明度(100是不透明),这里实现不透明效果 158 //将覆盖图复制到目标图片上,最后个参数100是设置透明度(100是不透明),这里实现不透明效果
158 - imagecopymerge($dst, $src, $x, $y, 0, 0, $src_w, $src_h, 90); 159 + imagecopymerge($dst, $src,$a[0]-$b[0]-10, $a[1]-$b[1]-10, 0, 0, $src_w, $src_h, 90);
159 160
160 $this->outfile = $this->cache_dir.DS.time().'.png'; 161 $this->outfile = $this->cache_dir.DS.time().'.png';
161 imagepng($dst, $this->outfile);//根据需要生成相应的图片 162 imagepng($dst, $this->outfile);//根据需要生成相应的图片