|
@@ -11,6 +11,7 @@ use app\models\user\UserBill;
|
|
|
use app\models\user\UserExtract;
|
|
|
use app\Request;
|
|
|
use crmeb\services\GroupDataService;
|
|
|
+use crmeb\services\QrcodeService;
|
|
|
use crmeb\services\SystemConfigService;
|
|
|
use crmeb\services\UtilService;
|
|
|
use crmeb\services\upload\Upload;
|
|
@@ -184,7 +185,6 @@ class UserBillController
|
|
|
if ($uploadRes === false) {
|
|
|
return app('json')->fail($upload->getError());
|
|
|
}
|
|
|
- $upload->delete($name);
|
|
|
$imageInfo = $upload->getUploadInfo();
|
|
|
$imageInfo['image_type'] = $uploadType;
|
|
|
SystemAttachment::attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
|
@@ -192,7 +192,7 @@ class UserBillController
|
|
|
$urlCode = $imageInfo['dir'];
|
|
|
} else $urlCode = $imageInfo['att_dir'];
|
|
|
if ($imageInfo['image_type'] == 1) $urlCode = $siteUrl . $urlCode;
|
|
|
- $siteUrlHttps = set_http_type($siteUrl, $request->isSsl() ? 0 : 1);
|
|
|
+ $siteUrlHttps = set_http_type($siteUrl, 0);
|
|
|
$filelink = [
|
|
|
'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
|
'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
@@ -244,7 +244,7 @@ class UserBillController
|
|
|
if ($posterInfo['image_type'] == 1)
|
|
|
$item['poster'] = $siteUrlHttps . $posterInfo['dir'];
|
|
|
else
|
|
|
- $item['poster'] = set_http_type($posterInfo['dir'], $request->isSsl() ? 0 : 1);
|
|
|
+ $item['poster'] = set_http_type($posterInfo['dir'], 0);
|
|
|
$item['poster'] = str_replace('\\', '/', $item['poster']);
|
|
|
}
|
|
|
}
|
|
@@ -258,14 +258,19 @@ class UserBillController
|
|
|
SystemAttachment::where(['name' => $name])->delete();
|
|
|
}
|
|
|
if (!$imageInfo) {
|
|
|
- $codeUrl = set_http_type($siteUrl.'/index/#/?spread='.$user['uid'], $request->isSsl() ? 0 : 1);//二维码链接
|
|
|
- $imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
|
|
- if (is_string($imageInfo)) return app('json')->fail('二维码生成失败', ['error' => $imageInfo]);
|
|
|
- SystemAttachment::attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
|
|
- $urlCode = $imageInfo['dir'];
|
|
|
+// $qr_code = QrcodeService::getForeverQrcode('spread', $user['uid']);
|
|
|
+// if (isset($qr_code['url'])) {
|
|
|
+// $urlCode = $qr_code['url'];
|
|
|
+// } else {
|
|
|
+ $codeUrl = set_http_type($siteUrl . '/index/#/pages/public/register/?spread=' . $user['uid'], 1);//二维码链接
|
|
|
+ $imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
|
|
+ if (is_string($imageInfo)) return app('json')->fail('二维码生成失败', ['error' => $imageInfo]);
|
|
|
+ SystemAttachment::attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
|
|
+ $urlCode = $imageInfo['dir'];
|
|
|
+// }
|
|
|
} else $urlCode = $imageInfo['att_dir'];
|
|
|
if ($imageInfo['image_type'] == 1) $urlCode = $siteUrl . $urlCode;
|
|
|
- $siteUrl = set_http_type($siteUrl, $request->isSsl() ? 0 : 1);
|
|
|
+ $siteUrl = set_http_type($siteUrl, 1);
|
|
|
$filelink = [
|
|
|
'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
|
'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
@@ -279,12 +284,12 @@ class UserBillController
|
|
|
array(
|
|
|
'url' => $urlCode, //二维码资源
|
|
|
'stream' => 0,
|
|
|
- 'left' => 114,
|
|
|
- 'top' => 790,
|
|
|
+ 'left' => 225,
|
|
|
+ 'top' => 913,
|
|
|
'right' => 0,
|
|
|
'bottom' => 0,
|
|
|
- 'width' => 120,
|
|
|
- 'height' => 120,
|
|
|
+ 'width' => 300,
|
|
|
+ 'height' => 300,
|
|
|
'opacity' => 100
|
|
|
)
|
|
|
),
|
|
@@ -317,11 +322,10 @@ class UserBillController
|
|
|
if ($posterInfo['image_type'] == 1)
|
|
|
$item['wap_poster'] = $siteUrl . $posterInfo['thumb_path'];
|
|
|
else
|
|
|
- $item['wap_poster'] = set_http_type($posterInfo['thumb_path'], 1);
|
|
|
+ $item['wap_poster'] = UtilService::setHttpType($posterInfo['thumb_path'], 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- $routineSpreadBanner['uid'] = $request->uid();
|
|
|
if ($resRoutine && $resWap) return app('json')->successful($routineSpreadBanner);
|
|
|
else return app('json')->fail('生成图片失败');
|
|
|
} catch (\Exception $e) {
|