Update ShowPlanes.php
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user