|
@@ -161,6 +161,7 @@ class UserBillController
|
|
|
$resRoutine = true;//小程序
|
|
$resRoutine = true;//小程序
|
|
|
$resWap = true;//公众号
|
|
$resWap = true;//公众号
|
|
|
$siteUrl = sys_config('site_url');
|
|
$siteUrl = sys_config('site_url');
|
|
|
|
|
+ // 配置的海报背景模板
|
|
|
$routineSpreadBanner = sys_data('routine_spread_banner');
|
|
$routineSpreadBanner = sys_data('routine_spread_banner');
|
|
|
if (!count($routineSpreadBanner)) {
|
|
if (!count($routineSpreadBanner)) {
|
|
|
return app('json')->fail('暂无海报');
|
|
return app('json')->fail('暂无海报');
|
|
@@ -195,12 +196,12 @@ class UserBillController
|
|
|
$imageInfo = SystemAttachment::getInfo($name, 'name');
|
|
$imageInfo = SystemAttachment::getInfo($name, 'name');
|
|
|
//检测远程文件是否存在
|
|
//检测远程文件是否存在
|
|
|
// 20210722 注释掉,太卡
|
|
// 20210722 注释掉,太卡
|
|
|
- // if (isset($imageInfo['att_dir']) &&
|
|
|
|
|
- // strstr($imageInfo['att_dir'], 'http') !== false &&
|
|
|
|
|
- // curl_file_exist($imageInfo['att_dir']) === false) {
|
|
|
|
|
- // $imageInfo = null;
|
|
|
|
|
- // SystemAttachment::where(['name' => $name])->delete();
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (isset($imageInfo['att_dir']) &&
|
|
|
|
|
+ strstr($imageInfo['att_dir'], 'http') !== false &&
|
|
|
|
|
+ curl_file_exist($imageInfo['att_dir']) === false) {
|
|
|
|
|
+ $imageInfo = null;
|
|
|
|
|
+ SystemAttachment::where(['name' => $name])->delete();
|
|
|
|
|
+ }
|
|
|
if (!$imageInfo) {
|
|
if (!$imageInfo) {
|
|
|
$res = RoutineCode::getShareCode($user['uid'], 'spread', '', '');
|
|
$res = RoutineCode::getShareCode($user['uid'], 'spread', '', '');
|
|
|
if (!$res) return app('json')->fail('二维码生成失败');
|
|
if (!$res) return app('json')->fail('二维码生成失败');
|
|
@@ -220,8 +221,10 @@ class UserBillController
|
|
|
}
|
|
}
|
|
|
$upload->delete($name);
|
|
$upload->delete($name);
|
|
|
$imageInfo = $upload->getUploadInfo();
|
|
$imageInfo = $upload->getUploadInfo();
|
|
|
|
|
+ // 20210919 为了能小程序下载,这个函数上传的图片全部使用 https
|
|
|
|
|
+ $httpsUrl = set_http_type($imageInfo['dir']);
|
|
|
$imageInfo['image_type'] = $uploadType;
|
|
$imageInfo['image_type'] = $uploadType;
|
|
|
- SystemAttachment::attachmentAdd(basename($imageInfo['name']), $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
|
|
|
|
|
|
+ SystemAttachment::attachmentAdd(basename($imageInfo['name']), $imageInfo['size'], $imageInfo['type'], $httpsUrl, $httpsUrl, 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
|
|
RoutineQrcode::setRoutineQrcodeFind($res['id'], ['status' => 1, 'url_time' => time(), 'qrcode_url' => $imageInfo['dir']]);
|
|
RoutineQrcode::setRoutineQrcodeFind($res['id'], ['status' => 1, 'url_time' => time(), 'qrcode_url' => $imageInfo['dir']]);
|
|
|
$urlCode = $imageInfo['dir'];
|
|
$urlCode = $imageInfo['dir'];
|
|
|
} else {
|
|
} else {
|