From 552bd169eee7b14e94b54a6c4a552da857810ff1 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Thu, 13 Jun 2024 09:04:07 +0200 Subject: [PATCH] aa --- app/CustomFuncPao.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index 1dc80006..0fca4090 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\DB; use App\Article; +use App\Orderdetail; use Codexshaper\WooCommerce\Facades\Order; use Codexshaper\WooCommerce\Facades\Product; use Codexshaper\WooCommerce\Facades\Variation; @@ -241,6 +242,29 @@ function showOrdini() $str = "Ordini"; + $orders = Orderdetail::take(2)->get(); + + try { + + // Show the fields of the orders + foreach ($orders as $order) { + $str .= "Ordine: "; + $str .= getvalstr("Id", $order->id); + //$str .= getvalstr("DataOra", $order->DataOra); + //$str .= getvalstr("Totale", $order->Totale); + } + } catch (\Exception $e) { + return "Errore: " . $e->getMessage(); + } + + return $str; +} + +function showOrdini1() +{ + $str = "Ordini"; + + $orders = Order::orderBy('DataOra', 'desc')->take(2)->get(); try {