From 69d5004b6952d8be7ae64b7816eff8d0e9ceb23b Mon Sep 17 00:00:00 2001 From: Felipe Date: Wed, 28 Feb 2024 15:57:00 -0500 Subject: [PATCH] consulta mejorada --- app/Http/Livewire/ShowServicios.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index 9d8f39c..37802bd 100755 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -279,7 +279,11 @@ class ShowServicios extends Component $cantidad_necesaria = $this->cantidad_tarjetaPlan; - $cuenta = Cuentas::where('servicio_id', $this->servicio_id)->whereDate('inicio', '>=', $this->fecha)->whereDate('vencimiento','>=', $this->fechaFinal)->Orderby('created_at', 'ASC')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', $suma)->get(); + $cuenta = Cuentas::where('servicio_id', $this->servicio_id)->whereDate('inicio', '>=', $this->fecha) + ->whereDate('vencimiento', '>=', $this->fecha_final_1) + ->whereDate('vencimiento', '<=', $this->fecha_final_2) + // ->whereDate('vencimiento','>=', $this->fechaFinal) + ->Orderby('created_at', 'ASC')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', $suma)->get(); // dd($cuenta); } elseif ((int) $pantalla_servicio_completa == (int) $this->pantallas_tarjetaPlan) { //Cuentas completas