Merge branch 'main' of https://github.com/lizandrogd/sirpremiumv2
This commit is contained in:
@@ -34,6 +34,11 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
$schedule->exec('nohup php /home/u111286300/domains/sirpremium.com.co/public_html/app/artisan queue:work --sleep=3 --tries=3 > /dev/null 2>&1 &')->everyMinute();
|
||||
|
||||
|
||||
|
||||
// $schedule->exec('nohup php /var/www/sirpremium/artisan queue:work --sleep=3 --tries=3 > /dev/null 2>&1 &')->everyMinute();
|
||||
|
||||
|
||||
$schedule->call(function () {
|
||||
$fechaHoy = Carbon::now();
|
||||
$fechaManana = $fechaHoy->copy()->addDay(); // Obtenemos la fecha de mañana sumando un día a la fecha actual
|
||||
|
||||
@@ -63,10 +63,10 @@ class ShowIndexPromo extends Component
|
||||
|
||||
if (is_null($usuario_existe)) {
|
||||
$usuario = new User;
|
||||
$usuario->name = $this->nombre_tarjetaPlan;
|
||||
$usuario->email = $this->email_tarjetaPlan;
|
||||
$usuario->name = $this->nombre_comprarPromo;
|
||||
$usuario->email = $this->email_comprarPromo;
|
||||
$usuario->password = '123';
|
||||
$usuario->celular = $this->celular_tarjetaPlan;
|
||||
$usuario->celular = $this->celular_comprarPromo;
|
||||
$usuario->save();
|
||||
|
||||
$usuario_id = $usuario->id;
|
||||
|
||||
@@ -316,6 +316,25 @@ class ShowPromociones extends Component
|
||||
'confirmButtonText' => 'Sí, comprar.',
|
||||
]);
|
||||
}
|
||||
}else{
|
||||
|
||||
|
||||
$descuento = Saldo::where('usuario_id', Auth::user()->id)->first();
|
||||
$saldo_anterior = $descuento->valor;
|
||||
$nuevo_saldo = $saldo_anterior - ($this->precioAhora *$this->cantidad_comprarPromo);
|
||||
$cobro = $descuento->update(['valor' => $nuevo_saldo]);
|
||||
//dd($cobro);
|
||||
if ($cobro) {
|
||||
$historial->update(['estado' => 'activo']);
|
||||
$this->modalComprarPromo = false;
|
||||
$this->credenciales($historial);
|
||||
|
||||
} else {
|
||||
$eliminar = Historial_cuenta::whereIn('id',$this->n)->delete();
|
||||
//dd($eliminar);
|
||||
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
|
||||
'position' => 'top']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user