|
@@ -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;
|
|
@@ -258,11 +259,16 @@ class UserBillController
|
|
|
SystemAttachment::where(['name' => $name])->delete();
|
|
|
}
|
|
|
if (!$imageInfo) {
|
|
|
- $codeUrl = set_http_type($siteUrl . '/index/#/pages/index/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 . '?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);
|
|
@@ -270,7 +276,6 @@ class UserBillController
|
|
|
'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
|
'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
|
|
|
];
|
|
|
-
|
|
|
if (!file_exists($filelink['Bold'])) return app('json')->fail('缺少字体文件Bold');
|
|
|
if (!file_exists($filelink['Normal'])) return app('json')->fail('缺少字体文件Normal');
|
|
|
foreach ($routineSpreadBanner as $key => &$item) {
|
|
@@ -280,41 +285,40 @@ class UserBillController
|
|
|
array(
|
|
|
'url' => $urlCode, //二维码资源
|
|
|
'stream' => 0,
|
|
|
- 'left' => 114,
|
|
|
- 'top' => 790,
|
|
|
+ 'left' => 168,
|
|
|
+ 'top' => 825,
|
|
|
'right' => 0,
|
|
|
'bottom' => 0,
|
|
|
- 'width' => 120,
|
|
|
- 'height' => 120,
|
|
|
+ 'width' => 413,
|
|
|
+ 'height' => 413,
|
|
|
'opacity' => 100
|
|
|
)
|
|
|
),
|
|
|
'text' => array(
|
|
|
array(
|
|
|
- 'text' => $user['nickname'],
|
|
|
- 'left' => 250,
|
|
|
- 'top' => 840,
|
|
|
+ 'text' => "邀请码:" . $user['uid'],
|
|
|
+ 'left' => 280,
|
|
|
+ 'top' => 1286,
|
|
|
'fontPath' => $rootPath . 'public' . DS . $filelink['Bold'], //字体文件
|
|
|
- 'fontSize' => 16, //字号
|
|
|
- 'fontColor' => '40,40,40', //字体颜色
|
|
|
+ 'fontSize' => 30, //字号
|
|
|
+ 'fontColor' => '255,255,255', //字体颜色
|
|
|
'angle' => 0,
|
|
|
),
|
|
|
- array(
|
|
|
- 'text' => '邀请您加入' . sys_config('site_name'),
|
|
|
- 'left' => 250,
|
|
|
- 'top' => 880,
|
|
|
- 'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'], //字体文件
|
|
|
- 'fontSize' => 16, //字号
|
|
|
- 'fontColor' => '40,40,40', //字体颜色
|
|
|
- 'angle' => 0,
|
|
|
- )
|
|
|
+// array(
|
|
|
+// 'text' => '邀请您加入' . sys_config('site_name'),
|
|
|
+// 'left' => 250,
|
|
|
+// 'top' => 880,
|
|
|
+// 'fontPath' => $rootPath . 'public' . DS . $filelink['Normal'], //字体文件
|
|
|
+// 'fontSize' => 16, //字号
|
|
|
+// 'fontColor' => '40,40,40', //字体颜色
|
|
|
+// 'angle' => 0,
|
|
|
+// )
|
|
|
),
|
|
|
'background' => $item['pic']
|
|
|
);
|
|
|
$resWap = $resWap && $posterInfo = UtilService::setSharePoster($config, 'wap/spread/poster');
|
|
|
if (!is_array($posterInfo)) return app('json')->fail($posterInfo);
|
|
|
SystemAttachment::attachmentAdd($posterInfo['name'], $posterInfo['size'], $posterInfo['type'], $posterInfo['dir'], $posterInfo['thumb_path'], 1, $posterInfo['image_type'], $posterInfo['time'], 2);
|
|
|
-
|
|
|
if ($resWap) {
|
|
|
if ($posterInfo['image_type'] == 1)
|
|
|
$item['wap_poster'] = $siteUrl . $posterInfo['thumb_path'];
|