wherePublishingDate($publishingDate) ->wherePublishingNo($seqNo) ->exists() ) { throw new AppCommonException("利用済み"); } // 店舗特定 $relation = ShopNoRelation::whereShopNo($shopNo) ->whereParkingManagementCode($parkingManagementCode) ->whereQrServiceUseage(QRServiceUsage::印字方式) ->firstOrFail(); $qr = new PrintTicket(); $qr->publishing_terminal_code = $adjusterTerminalCode; $qr->publishing_date = $publishingDate; $qr->publishing_no = $seqNo; $qr->shop_id = $relation->shop_id; $qr->parking_management_code = $parkingManagementCode; $qr->used_at = $adjustDatetime; $qr->discount_amount = $discountAmount; // デポジット処理 self::useDeposit($qr->shop_id, $discountAmount, DepositTransferReason::駐車料金割引_印字); $qr->save(); } }