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