diff --git a/.env b/.env index 290b041..c40ebfb 100644 --- a/.env +++ b/.env @@ -9,11 +9,11 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=82.180.168.2 +DB_HOST=195.35.32.59 DB_PORT=3306 -DB_DATABASE=u111286300_sir -DB_USERNAME=u111286300_sir -DB_PASSWORD=Colombia2022* +DB_DATABASE=sirpremium +DB_USERNAME=pym +DB_PASSWORD=Nicolas2796*+ BROADCAST_DRIVER=log CACHE_DRIVER=file diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 2eb0b73..8b90bec 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -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 diff --git a/app/Http/Livewire/ShowIndexPromo.php b/app/Http/Livewire/ShowIndexPromo.php index 0d176d9..610866c 100644 --- a/app/Http/Livewire/ShowIndexPromo.php +++ b/app/Http/Livewire/ShowIndexPromo.php @@ -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; diff --git a/app/Http/Livewire/ShowPromociones.php b/app/Http/Livewire/ShowPromociones.php index 4b312bf..bc7aec3 100644 --- a/app/Http/Livewire/ShowPromociones.php +++ b/app/Http/Livewire/ShowPromociones.php @@ -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']); + } } } diff --git a/resources/views/livewire/show-promociones.blade.php b/resources/views/livewire/show-promociones.blade.php index 9ebca0a..6baa334 100644 --- a/resources/views/livewire/show-promociones.blade.php +++ b/resources/views/livewire/show-promociones.blade.php @@ -1004,6 +1004,7 @@ @if (!empty($cuenta->servicio->ver_url)) *URL:* {{ $cuenta->servicio->url }} @else + *Servicio:* {{ $cuenta->servicio->nombre }} @foreach ($cuenta->perfil as $perfil) @if ($cuentas->id == $perfil->historial_id && $cuenta->estado == 'activo') - Perfil {{ $perfil->perfil }} @if (!empty($cuenta->servicio->perfiles)) diff --git a/resources/views/livewire/show-servicios.blade.php b/resources/views/livewire/show-servicios.blade.php index c97f855..f30f7ac 100644 --- a/resources/views/livewire/show-servicios.blade.php +++ b/resources/views/livewire/show-servicios.blade.php @@ -391,7 +391,7 @@ @php $n = 0; @endphp - {{ dd($cuentas->cuentas) }} + @foreach ($cuentas->cuentas->unique() as $cuenta) @php $n++;