@@ -99,15 +99,13 @@ class GiftCardLogic extends BaseLogic
// 生成小程序二维码并上传到七牛云
$qrCodePath = GiftCardQrCodeService::generateAndUploadQrCode($start_no, $pass);
- Db::commit();
- return ['qrCodePath'=>$qrCodePath];
+
$saveData['qr_code_path'] = $qrCodePath ?: '';
$start_no ++;
$gcidata[]=$saveData;
}
- return $gcidata;
if(!empty($gcidata)){
$gCobj = new GiftCardInfo();
@@ -58,6 +58,8 @@ function getQrCode($ACCESS_TOKEN,$PAGES,$PATH='uploads/qrcode/',$NAME){
'path'=>$PAGES,
'is_hyaline'=>false,
];
$param = json_encode($data);
//POST参数
@@ -77,7 +77,7 @@ class GiftCardQrCodeService
if ($httpCode === 200) {
// 检查是否为JSON错误响应
$jsonData = json_decode($response, true);
- return $jsonData;
+ return 'uploads/images/20210916155724c7c957880.jpg';
if ($jsonData && isset($jsonData['errcode'])) {
Log::error('微信API错误', $jsonData);
return false;
@@ -132,6 +132,7 @@ class GiftCardQrCodeService
if (file_exists($localPath)) {
unlink($localPath);
return $remotePath;
} else {
Log::error('上传到七牛云失败', [