|
|
|
@ -48,9 +48,9 @@ class InviteUser extends BaseQRcode |
|
|
|
|
public function getImage(): string |
|
|
|
|
{ |
|
|
|
|
// 判断海报图文件存在则直接返回url |
|
|
|
|
if (file_exists($this->getPosterPath())) { |
|
|
|
|
return $this->getPosterUrl(); |
|
|
|
|
} |
|
|
|
|
// if (file_exists($this->getPosterPath())) { |
|
|
|
|
// return $this->getPosterUrl(); |
|
|
|
|
// } |
|
|
|
|
// 商城ID |
|
|
|
|
$storeId = $this->userInfo['store_id']; |
|
|
|
|
$backdrop = __DIR__ . '/resource/invite_user.png'; |
|
|
|
@ -63,8 +63,12 @@ class InviteUser extends BaseQRcode |
|
|
|
|
// 下载小程序码 |
|
|
|
|
$page = 'pages/login/index'; |
|
|
|
|
$qrcode = $this->getQrcode($storeId, $scene, $page, $this->channel); |
|
|
|
|
//获取图片名称 |
|
|
|
|
$arr = explode('/', $qrcode); |
|
|
|
|
$name = end($arr); |
|
|
|
|
return base_url() . 'temp/' . $this->userInfo['store_id'] . '/' . $name . '?t=' . time(); |
|
|
|
|
// 拼接海报图 |
|
|
|
|
return $this->savePoster($backdrop, $qrcode); |
|
|
|
|
//return $this->savePoster($backdrop, $qrcode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -83,9 +87,9 @@ class InviteUser extends BaseQRcode |
|
|
|
|
// 打开小程序码 |
|
|
|
|
$editor->open($qrcodeImage, $qrcode); |
|
|
|
|
// 重设小程序码宽高 |
|
|
|
|
$editor->resizeExact($qrcodeImage, 140, 140); |
|
|
|
|
$editor->resizeExact($qrcodeImage, 110, 110); |
|
|
|
|
// 小程序码添加到背景图 |
|
|
|
|
$editor->blend($backdropImage, $qrcodeImage, 'normal', 1.0, 'top-left', 520, 700); |
|
|
|
|
$editor->blend($backdropImage, $qrcodeImage, 'normal', 1.0, 'top-left', 175, 555); |
|
|
|
|
// 保存图片 |
|
|
|
|
$editor->save($backdropImage, $this->getPosterPath()); |
|
|
|
|
return $this->getPosterUrl(); |
|
|
|
|