From 4fc12d3e96f7be6020cd63e47e784da7932da975 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Mon, 8 Jul 2024 14:41:21 +0200 Subject: [PATCH] add check orders log --- config/logging.php | 6 ++++++ routes/web.php | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/logging.php b/config/logging.php index 6030c461..8f0cd9a5 100644 --- a/config/logging.php +++ b/config/logging.php @@ -112,6 +112,12 @@ return [ 'level' => 'info', 'days' => 30, ], + 'checkorders' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/checkorders.log'), + 'level' => 'info', + 'days' => 30, + ], 'updateproductsused' => [ 'driver' => 'daily', 'path' => storage_path('logs/updateproductsused/update.log'), diff --git a/routes/web.php b/routes/web.php index 31f483c7..9af9ee94 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2151,7 +2151,6 @@ Route::post('/updatecreate', function (Request $request) { try { - if (($request->status == 'on-hold' && $request->payment_method == 'bacs') || ($request->status == 'processing' && $request->payment_method == 'wc_gateway_gestpay') || ($request->status == 'processing' && $request->payment_method == 'paypal')) { $productLogger = new ProductLogger(null, 'neworders'); $productLogger->addLog('', 'updatecreate: ARRIVATO ORDINE'); @@ -2300,6 +2299,15 @@ Route::post('/updatecreate', function (Request $request) { } $productLogger->setLogandSendEmail('Nuovo Ordine !'); + } else { + $productLogger = new ProductLogger(null, 'checkorders'); + $productLogger->addLog('', 'updatecreate: CHECK ORDINE...'); + + try { + $productLogger->addLog('', json_encode($request->all())); + } catch (Exception $e) { + } + } //end if status } catch (Exception $e) { Log::error($e->getMessage());