From 30146051b885695c2ae53ef09354774dfb7d12f8 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 11 May 2024 16:04:42 -0500 Subject: [PATCH] Update ShowPlanes.php --- app/Http/Livewire/ShowPlanes.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 5c2b556..21d345a 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -319,15 +319,15 @@ class ShowPlanes extends Component $this->tiempo_usuario = $this->fecha_final_renovar->diffInDays($this->fecha_inicial_renovar); $id = $this->id_cuentaVer; - dd( date('Y-m-d', strtotime(strval($this->fecha_inicial_renovar)))); + //dd( date('Y-m-d', strtotime(strval($this->fecha_final_renovar)))); // Corrección 2: Verifica que la cuenta exista antes de intentar actualizarla $cuenta = Cuentas::find($id); if ($cuenta) { $cuenta->update([ 'correo' => $this->usuario_renovar, 'password' => $this->password_renovar, - 'inicio' => date('Y-m-d', strtotime(strval($this->fecha_inicial_renovar))), - 'vencimiento' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))), + //'inicio' => date('Y-m-d', strtotime(strval($this->fecha_inicial_renovar))), + //'vencimiento' => date('Y-m-d', strtotime(strval($this->fecha_final_renovar))), 'estado' => $this->estado, ]); @@ -336,6 +336,7 @@ class ShowPlanes extends Component $historiales = Historiale::whereIn('id', $id_historiales)->get(); foreach ($historiales as $historial) { + dd($historial->fecha_final->addDays($this->tiempo_usuario)->format('Y-m-d')); // Corrección 3: Usa la fecha final original del historial para calcular la nueva fecha final $nueva_fecha_final = $historial->fecha_final->addDays($this->tiempo_usuario)->format('Y-m-d');