From 31963b64d3f44f3f941e30d837d2c47bb4c1b33f Mon Sep 17 00:00:00 2001 From: Felipe Date: Thu, 2 Jan 2025 09:09:14 -0500 Subject: [PATCH] cuando sea diciembre y le damos mes pasado me va a mostrar los del ano pasado --- app/Http/Livewire/ShowTop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Livewire/ShowTop.php b/app/Http/Livewire/ShowTop.php index 3a3e69b..09abb50 100755 --- a/app/Http/Livewire/ShowTop.php +++ b/app/Http/Livewire/ShowTop.php @@ -22,9 +22,9 @@ class ShowTop extends Component { $this->configuracion = Configuracione::orderby('id', 'desc')->first(); - $currentYear = date('Y'); $monthYear = date('m-Y', strtotime('last month')); $month = $this->showLastMonth ? date('m', strtotime('last month')) : date('m'); + $currentYear = $this->showLastMonth && $month == 12 ? date('Y', strtotime('last year')) : date('Y'); $consulta_ventas = User::with(['historiales_venta' => function ($query) use ($month, $currentYear) { $query->whereMonth('fecha_inicio', $month)