moonsflyer 4 месяцев назад
Родитель
Сommit
e72295afc7
1 измененных файлов с 26 добавлено и 26 удалено
  1. 26 26
      app/common/service/GiftCardQrCodeService.php

+ 26 - 26
app/common/service/GiftCardQrCodeService.php

@@ -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;
     }
-}
+}