|
|
@@ -55,31 +55,31 @@ class GiftCardQrCodeService
|
|
|
|
|
|
// Generate Qiniu cloud storage path
|
|
|
$remotePath = 'gift_card_qrcode/' . date('Ymd') . '/' . $tempFileName;
|
|
|
- return $remotePath;
|
|
|
- // Upload to Qiniu cloud
|
|
|
-// if (self::uploadToQiniu($tempFilePath, $remotePath)) {
|
|
|
-// // Delete temp file
|
|
|
-// // unlink($tempFilePath);
|
|
|
-//
|
|
|
-// // Return Qiniu cloud file path
|
|
|
-// $config = ConfigService::get('storage', 'qiniu', []);
|
|
|
-// $domain = rtrim($config['domain'] ?? '', '/');
|
|
|
-// $fullUrl = $domain . '/' . $remotePath;
|
|
|
-//
|
|
|
-// Log::info('Regular QR code generated and uploaded successfully', [
|
|
|
-// 'cardNo' => $cardNo,
|
|
|
-// 'remotePath' => $remotePath,
|
|
|
-// 'fullUrl' => $fullUrl
|
|
|
-// ]);
|
|
|
-//
|
|
|
-// return $fullUrl;
|
|
|
-// } else {
|
|
|
-// // Upload failed, delete temp file
|
|
|
-// if (file_exists($tempFilePath)) {
|
|
|
-// unlink($tempFilePath);
|
|
|
-// }
|
|
|
-// return false;
|
|
|
-// }
|
|
|
+// return $remotePath;
|
|
|
+// Upload to Qiniu cloud
|
|
|
+ if (self::uploadToQiniu($tempFilePath, $remotePath)) {
|
|
|
+ // Delete temp file
|
|
|
+ unlink($tempFilePath);
|
|
|
+
|
|
|
+ // Return Qiniu cloud file path
|
|
|
+ $config = ConfigService::get('storage', 'qiniu', []);
|
|
|
+ $domain = rtrim($config['domain'] ?? '', '/');
|
|
|
+ $fullUrl = $domain . '/' . $remotePath;
|
|
|
+
|
|
|
+ Log::info('Regular QR code generated and uploaded successfully', [
|
|
|
+ 'cardNo' => $cardNo,
|
|
|
+ 'remotePath' => $remotePath,
|
|
|
+ 'fullUrl' => $fullUrl
|
|
|
+ ]);
|
|
|
+
|
|
|
+ return $fullUrl;
|
|
|
+ } else {
|
|
|
+ // Upload failed, delete temp file
|
|
|
+ if (file_exists($tempFilePath)) {
|
|
|
+ unlink($tempFilePath);
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
outFileLog( $e->getMessage(),'qrcode',' $e->getMessage()');
|
|
|
@@ -233,4 +233,4 @@ class GiftCardQrCodeService
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
-}
|
|
|
+}
|