From 405b27178f696cc341f9721eeca0af13daa21263 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 30 Apr 2024 17:53:18 -0500 Subject: [PATCH] Update ShowPlanes.php --- app/Http/Livewire/ShowPlanes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index e3be8b6..380ed52 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -116,6 +116,7 @@ class ShowPlanes extends Component public $notaEliminarVariosModal = false; public $nota_eliminacion; public $cont; + public $tiempo_usuario; @@ -222,6 +223,7 @@ class ShowPlanes extends Component public function calcularFechas() { $this->fecha_final_renovar = Carbon::parse($this->fecha_final_renovar)->addDays(30)->format('Y-m-d'); + $this->tiempo_usuario = 30; } @@ -279,8 +281,11 @@ class ShowPlanes extends Component $historial = Historial_cuenta::where('cuenta_id', $id)->first(); + $consultaFechaFinal = Historiale::where('id', $historial->historiale_id)->fecha_final; + $nuevaFecha= $consultaFechaFinal->addDays($this->tiempo_usuario); + Historiale::where('id', $historial->historiale_id)->update([ - 'fecha_final' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))), + 'fecha_final' => date('Y-m-d', strtotime(strval($nuevaFecha))), ]); $cuenta_renovar = Cuentas::find($id);