From 417b0a8ee6e07ed2738297cbda2dc0c0782d9b58 Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Mon, 17 Feb 2025 20:39:23 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8D=B0=E5=AD=97=E6=96=B9=E5=BC=8F=20?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E6=B8=88=E3=81=BF=E3=83=AD=E3=82=B0=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Logics/QRService/PrintingLogic.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Logics/QRService/PrintingLogic.php b/app/Logics/QRService/PrintingLogic.php index 1bb9628..a0a6f2c 100644 --- a/app/Logics/QRService/PrintingLogic.php +++ b/app/Logics/QRService/PrintingLogic.php @@ -7,6 +7,7 @@ use App\Codes\Model\QRServiceUsage; use App\Exceptions\AppCommonException; use App\Models\HtpmsCustomer\Mst\ShopNoRelation; use App\Models\HtpmsCustomer\QRService\PrintTicket; +use App\Sessions\SessionUser; use Illuminate\Support\Carbon; class PrintingLogic @@ -37,12 +38,22 @@ class PrintingLogic ) { // 重複利用チェック - if (PrintTicket::wherePublishingTerminalCode($adjusterTerminalCode) + $used = PrintTicket::wherePublishingTerminalCode($adjusterTerminalCode) ->wherePublishingDate($publishingDate) ->wherePublishingNo($seqNo) - ->exists() - ) { - throw new AppCommonException("利用済み"); + ->first(); + if ($used !== null) { + $user = SessionUser::instance(); + $message = sprintf( + "利用済み customer_code:%s parking_management_code:%s terminal:%s date:%s no:%d used_at:%s", + $user->customerCode(), + $parkingManagementCode, + $adjusterTerminalCode, + $publishingDate->format('Y/m/d'), + $seqNo, + $used->used_at->format('Y/m/d H:i:s') + ); + throw new AppCommonException($message); } // 店舗特定