logpromociones y menu mas arriba
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Configuracione;
|
||||
use App\Models\Cuentas;
|
||||
use App\Models\Historial_cuenta;
|
||||
use App\Models\Historiale;
|
||||
use App\Models\Log_general;
|
||||
use App\Models\Pendientes;
|
||||
use App\Models\Promocion_tarifa;
|
||||
use App\Models\Promociones;
|
||||
@@ -207,6 +208,8 @@ class ShowPromociones extends Component
|
||||
|
||||
public function pagar()
|
||||
{
|
||||
dd($this->consulta);
|
||||
|
||||
$this->validate();
|
||||
|
||||
if ($this->cantidad_comprarPromo == 0) {
|
||||
@@ -331,8 +334,6 @@ class ShowPromociones extends Component
|
||||
'confirmButtonText' => 'Sí, comprar.',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$descuento = Saldo::where('usuario_id', Auth::user()->id)->first();
|
||||
$saldo_anterior = $descuento->valor;
|
||||
@@ -341,6 +342,12 @@ class ShowPromociones extends Component
|
||||
|
||||
if ($cobro) {
|
||||
$historial->update(['estado' => 'activo']);
|
||||
|
||||
$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 ?? '';
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->modalComprarPromo = false;
|
||||
$this->credenciales($historial);
|
||||
} else {
|
||||
@@ -376,6 +383,11 @@ 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';
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->credenciales($this->historial);
|
||||
} else {
|
||||
Historial_cuenta::whereIn('id', $this->n)->delete();
|
||||
|
||||
Reference in New Issue
Block a user