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

+ 25 - 24
app/common/service/GiftCardQrCodeService.php

@@ -57,36 +57,37 @@ class GiftCardQrCodeService
             $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;
-            }
+//            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()');
             Log::error('Failed to generate regular QR code', [
                 'error' => $e->getMessage(),
                 'trace' => $e->getTraceAsString()
             ]);
-            return false;
+//            return false;
         }
     }