Se agrego tipo a log_general.

This commit is contained in:
lizandrogd
2025-02-27 10:55:12 -05:00
parent 33859c8777
commit 76bd9df10e
10 changed files with 54 additions and 3 deletions
+4
View File
@@ -364,6 +364,7 @@ class ShowPromociones extends Component
$logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado la promocion ' . $this->consulta->nombre . ' - ' . $this->consulta->descripcion . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor .', Saldo anterior: $'.$saldo_anterior.', Nuevo saldo disponible: $'.$nuevo_saldo;
$logsGeneral->estado = 'compra';
$logsGeneral->save();
$this->modalComprarPromo = false;
@@ -404,6 +405,7 @@ class ShowPromociones extends Component
$logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado la promocion ' . $this->consulta->nombre . ' - ' . $this->consulta->descripcion . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor ?? '' . ' y algunos han quedado pendientes'.', Saldo anterior: $'.$saldo_anterior.', Nuevo saldo disponible: $'.$nuevo_saldo;
$logsGeneral->estado = 'compra';
$logsGeneral->save();
$this->credenciales($this->historial);
@@ -412,6 +414,7 @@ class ShowPromociones extends Component
$logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error en el cobro, Comprando la promoción ' . $this->consulta->nombre . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor .' No se desconto el saldo, ni se asignaron cuentas.';
$logsGeneral->estado = 'compra_error';
$logsGeneral->save();
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
'position' => 'top'
@@ -434,6 +437,7 @@ class ShowPromociones extends Component
$logsGeneral = new Log_general();
$logsGeneral->user_id = Auth::user()->id;
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Cancelo la compra del plan ' . $this->consulta->nombre . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor.' No se desconto el saldo, ni se asignaron cuentas.';
$logsGeneral->estado = 'compra_cancelada';
$logsGeneral->save();
$this->alert('success', 'Compra cancelada!', [
'position' => 'top'