|
@@ -35,13 +35,18 @@ class Userposter extends Api
|
|
|
'padding' => 0,
|
|
|
];
|
|
|
$qrCode = \addons\qrcode\library\Service::qrcode($params);
|
|
|
- $qrcode_path = 'uploads/hbplayer/'.date('Ymd');
|
|
|
- mk_dir($qrcode_path);
|
|
|
- $download_qrcode = $qrcode_path.'/download'.$player_id.'.png';
|
|
|
- $qrCode->writeFile($download_qrcode);
|
|
|
-
|
|
|
+ $qrcode_path = ROOT_PATH . 'public/uploads/hbplayer/'.date('Ymd');
|
|
|
+ if (!is_dir($qrcode_path)) {
|
|
|
+ @mkdir($qrcode_path);
|
|
|
+ }
|
|
|
+ if (is_really_writable($qrcode_path)) {
|
|
|
+ $filename = 'download'.$player_id.'.png';
|
|
|
+ $download_qrcode = $qrcode_path.'/'.$filename;
|
|
|
+ $qrCode->writeFile($download_qrcode);
|
|
|
+ }
|
|
|
//海报
|
|
|
- $haibao = $this->createhaibao($download_qrcode,$player_id,$data);
|
|
|
+ $filepath = '/uploads/hbplayer/'.date('Ymd') .'/'. $filename;
|
|
|
+ $haibao = $this->createhaibao($filepath,$player_id,$data);
|
|
|
|
|
|
return $haibao;
|
|
|
}
|
|
@@ -68,7 +73,6 @@ class Userposter extends Api
|
|
|
|
|
|
public function createhaibao($download_qrcode,$player_id,$sub_data){
|
|
|
//二维码
|
|
|
- $download_qrcode= config('img_url').'/'.$download_qrcode;
|
|
|
|
|
|
$data = [
|
|
|
[
|
|
@@ -105,18 +109,17 @@ class Userposter extends Api
|
|
|
"type" => "img",
|
|
|
"width" => "80px",
|
|
|
"height" => "80px",
|
|
|
-// "src" => httpurllocal($inviteimage)//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
|
|
|
- "src" => $download_qrcode//"https://metavision.oss-cn-hongkong.aliyuncs.com/uploads/20220615/f00cb545deb4c4e7296f444239d83e84.jpg"
|
|
|
+ "src" => httpurllocal($download_qrcode)
|
|
|
]
|
|
|
];
|
|
|
|
|
|
$data = json_encode($data, 320);
|
|
|
|
|
|
$poster = [
|
|
|
- 'id' => 1,
|
|
|
- 'title' => '测试2',
|
|
|
+ 'id' => $this->auth->id,
|
|
|
+ 'title' => '星链',
|
|
|
'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
|
|
|
- 'bg_image' => $sub_data['background'] ? cdnurl($sub_data['background']) : '/assets/img/inviteposter.png',
|
|
|
+ 'bg_image' => $sub_data['background'] ? localpath_to_netpath($sub_data['background']) : '/assets/img/inviteposter.png',
|
|
|
'data' => $data,
|
|
|
'status' => 'normal',
|
|
|
'weigh' => 0,
|