Update validacionCompra.php

This commit is contained in:
lizandrogd
2025-02-27 19:41:44 -05:00
parent b4a0baa0e1
commit 439544ef56
+8 -1
View File
@@ -98,7 +98,7 @@ class validacionCompra extends Command
'detalle' => 'Se ha corregido la compra duplicada, usuario: ' . $email . ' - ' .
Carbon::parse($registro->created_at)->format('d M Y h:i A') . ' - ' .
Carbon::parse($anterior->created_at)->format('d M Y h:i A'),
]);
]);
}
}
@@ -154,6 +154,8 @@ class validacionCompra extends Command
$historial_actual->estado = 'cancelado';
$historial_actual->save();
$cuentahistorial = Historial_cuenta::where('historial_id', $historial_actual->id)->get();
// Eliminar cuentas asociadas
if (!$cuentahistorial->isEmpty()) {
@@ -162,6 +164,11 @@ class validacionCompra extends Command
}
}
Log_general::where('historial_id', $actual)
->where('tipo', 'compra')
->update(['tipo' => 'revertida']);
DB::commit(); // Confirmar la transacción
return true; //