|
|
@@ -706,7 +706,18 @@ class Order extends Base |
|
|
|
//生成二维码图片 |
|
|
|
\QRcode::png($value, $QRFile, $errorCorrectionLevel, $matrixPointSize, 2); |
|
|
|
$QR = imagecreatefromstring(file_get_contents($QRFile)); |
|
|
|
|
|
|
|
//二维码 |
|
|
|
$logoUrl = imagecreatefromstring(file_get_contents(ROOT_PATH . '/addons/unishop/library/phpqrcode/logo.png')); |
|
|
|
$QR_width = imagesx($QR);//二维码图片宽度 |
|
|
|
$logo_width = imagesx($logoUrl);//logo图片宽度 |
|
|
|
$logo_height = imagesy($logoUrl);//logo图片高度 |
|
|
|
$logo_qr_width = $QR_width / 5; |
|
|
|
$scale = $logo_width / $logo_qr_width; |
|
|
|
$logo_qr_height = $logo_height / $scale; |
|
|
|
$from_width = ($QR_width - $logo_qr_width) / 2; |
|
|
|
//重新组合图片并调整大小 |
|
|
|
imagecopyresampled($QR, $logoUrl, $from_width, $from_width, 0, 0, $logo_qr_width, |
|
|
|
$logo_qr_height, $logo_width, $logo_height); |
|
|
|
//输出图片 |
|
|
|
Header("Content-type: image/png"); |
|
|
|
ImagePng($QR); |
|
|
|