From 377bfabdfb62b8378bac4583117910d947d460bb Mon Sep 17 00:00:00 2001 From: Felipe Date: Wed, 28 Feb 2024 16:16:06 -0500 Subject: [PATCH] 15 dias de margen --- app/Http/Livewire/ShowServicios.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index 37802bd..17c3349 100755 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -137,27 +137,21 @@ class ShowServicios extends Component ->pluck('id')) ->count(); - - - - //$prueba1 = $this->cuentas_creadas->count() * $this->servicio_t->pantallas ; - //$prueba2 = $this->cuentas_tomadas ; - - $this->servicio_id = $this->servicio_t->id; $this->tarifa_id = $id; $this->servicio_tarjetaPlan = $this->servicio_t->nombre; $this->tiempo_tarjetaPlan = $this->servicio_t->por_tiempo; $this->pantallas_tarjetaPlan = $this->tarifas->pantallas; $this->dias_tarjetaPlan = $this->tarifas->dias; - $this->fecha_final_1 = $today = Carbon::now(); - $this->fecha_final_2 = $today = Carbon::now(); + $this->fecha_final_1 = Carbon::now()->addDays($this->tarifas->dias - 15); + $this->fecha_final_2 = Carbon::now()->addDays($this->tarifas->dias + 15); $this->mensaje = $this->servicio_t->mensaje; + //Servicio por cuenta completa $this->cuentas_completas = Cuentas::whereDate('inicio', '>=', $this->fecha) - ->whereDate('vencimiento', '>=', $this->fecha_final_1->addDays($this->tarifas->dias - 20)) - ->whereDate('vencimiento', '<=', $this->fecha_final_2->addDays($this->tarifas->dias + 20)) + ->whereDate('vencimiento', '>=', $this->fecha_final_1) + ->whereDate('vencimiento', '<=', $this->fecha_final_2) ->where('servicio_id', $this->tarifas->servicio->id) ->where('estado', 'pendiente') ->get(); @@ -300,7 +294,6 @@ class ShowServicios extends Component $cantidad_necesaria = null; } - for ($h = 0; $h < (int) $cantidad_necesaria; $h++) { if (!empty($cuenta)) {