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