|
|
@@ -27,23 +27,24 @@ class GiftCardQrCodeService
|
|
|
try {
|
|
|
// Generate regular QR code with cardPass as content
|
|
|
$qrContent = $cardPass;
|
|
|
-
|
|
|
+ outFileLog($qrContent, 'qr_code', '$qrContent');
|
|
|
// Generate local temp file path
|
|
|
$tempDir = runtime_path() . 'temp' . DIRECTORY_SEPARATOR;
|
|
|
if (!is_dir($tempDir)) {
|
|
|
mkdir($tempDir, 0755, true);
|
|
|
}
|
|
|
-
|
|
|
+ outFileLog($tempDir, 'qr_code', '$tempDir');
|
|
|
$tempFileName = 'qrcode_' . $cardNo . '_' . time() . '.png';
|
|
|
$tempFilePath = $tempDir . $tempFileName;
|
|
|
-
|
|
|
+ outFileLog($tempFileName, 'qr_code', '$tempFileName');
|
|
|
+ outFileLog($tempFilePath, 'qr_code', '$tempFilePath');
|
|
|
// 修改这部分:使用Generator类而不是Facade
|
|
|
$qrCode = new Generator();
|
|
|
$qrCode->size(430)
|
|
|
->margin(2)
|
|
|
->format('png')
|
|
|
->generate($qrContent, $tempFilePath);
|
|
|
-
|
|
|
+ outFileLog($qrCode, 'qr_code', '$qrCode');
|
|
|
Log::info('Regular QR code generated successfully', [
|
|
|
'cardNo' => $cardNo,
|
|
|
'scene' => $cardPass,
|
|
|
@@ -53,17 +54,17 @@ class GiftCardQrCodeService
|
|
|
|
|
|
// Generate Qiniu cloud storage path
|
|
|
$remotePath = 'gift_card_qrcode/' . date('Ymd') . '/' . $tempFileName;
|
|
|
-
|
|
|
+ outFileLog($remotePath, 'qr_code', '$remotePath');
|
|
|
// Upload to Qiniu cloud
|
|
|
if (self::uploadToQiniu($tempFilePath, $remotePath)) {
|
|
|
// Delete temp file
|
|
|
- unlink($tempFilePath);
|
|
|
+// unlink($tempFilePath);
|
|
|
|
|
|
// Return Qiniu cloud file path
|
|
|
$config = ConfigService::get('storage', 'qiniu', []);
|
|
|
$domain = rtrim($config['domain'] ?? '', '/');
|
|
|
$fullUrl = $domain . '/' . $remotePath;
|
|
|
-
|
|
|
+ outFileLog($fullUrl, 'qr_code', '$fullUrl');
|
|
|
Log::info('Regular QR code generated and uploaded successfully', [
|
|
|
'cardNo' => $cardNo,
|
|
|
'remotePath' => $remotePath,
|