diff --git a/app/Http/Livewire/ShowPromociones.php b/app/Http/Livewire/ShowPromociones.php index bc7aec3..7418b50 100755 --- a/app/Http/Livewire/ShowPromociones.php +++ b/app/Http/Livewire/ShowPromociones.php @@ -317,21 +317,17 @@ class ShowPromociones extends Component ]); } }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']); } @@ -350,12 +346,15 @@ class ShowPromociones extends Component $this->modalComprarPromo = false; foreach ($this->f as $serviceId) { - $pendiente = new Pendientes(); - $pendiente->historial_id = $this->historial->id; - $pendiente->cantidad = $this->cantidad_comprarPromo; - $pendiente->estado = 'pendiente'; - $pendiente->servicio_id = $serviceId; - $pendiente->save(); + + for ($y = 0; $y < (int)$this->cantidad_comprarPromo; $y++) { + $pendiente = new Pendientes(); + $pendiente->historial_id = $this->historial->id; + $pendiente->cantidad = '1'; + $pendiente->estado = 'pendiente'; + $pendiente->servicio_id = $serviceId; + $pendiente->save(); + } } $this->credenciales($this->historial); diff --git a/composer.json b/composer.json index df17064..c86dc4d 100755 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "livewire/livewire": "^2.10", "maatwebsite/excel": "^3.1", "mercadopago/dx-php": "^2.5", + "nesbot/carbon": "*", "psr/simple-cache": "^3.0", "rmccue/requests": "^2.0", "twilio/sdk": "5.0" diff --git a/composer.lock b/composer.lock index 7539d03..663d855 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "843e42abd278d892e18df781a855ae21", + "content-hash": "6cc4cc6b404362193eba2971788ab00d", "packages": [ { "name": "aprendible/storage-link-route", @@ -4941,16 +4941,16 @@ }, { "name": "ramsey/uuid", - "version": "4.7.4", + "version": "4.7.5", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "60a4c63ab724854332900504274f6150ff26d286" + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286", - "reference": "60a4c63ab724854332900504274f6150ff26d286", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", + "reference": "5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e", "shasum": "" }, "require": { @@ -5017,7 +5017,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.4" + "source": "https://github.com/ramsey/uuid/tree/4.7.5" }, "funding": [ { @@ -5029,20 +5029,20 @@ "type": "tidelift" } ], - "time": "2023-04-15T23:01:58+00:00" + "time": "2023-11-08T05:53:05+00:00" }, { "name": "rmccue/requests", - "version": "v2.0.8", + "version": "v2.0.9", "source": { "type": "git", "url": "https://github.com/WordPress/Requests.git", - "reference": "fae75bcb83d9d00d0e31ee86a472a036f9f91519" + "reference": "422612952ff3bd5163039f8889eaaaab95a432eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/Requests/zipball/fae75bcb83d9d00d0e31ee86a472a036f9f91519", - "reference": "fae75bcb83d9d00d0e31ee86a472a036f9f91519", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/422612952ff3bd5163039f8889eaaaab95a432eb", + "reference": "422612952ff3bd5163039f8889eaaaab95a432eb", "shasum": "" }, "require": { @@ -5116,7 +5116,7 @@ "issues": "https://github.com/WordPress/Requests/issues", "source": "https://github.com/WordPress/Requests" }, - "time": "2023-09-11T08:27:57+00:00" + "time": "2023-11-08T19:22:04+00:00" }, { "name": "symfony/console", @@ -10477,5 +10477,9 @@ "php": "^8.0.2" }, "platform-dev": [], +<<<<<<< HEAD "plugin-api-version": "2.6.0" +======= + "plugin-api-version": "2.3.0" +>>>>>>> 0639a78129036a7cb0a4537f0b654bb34a67b06d } diff --git a/resources/views/livewire/bell.blade.php b/resources/views/livewire/bell.blade.php index 0a2159d..d839698 100755 --- a/resources/views/livewire/bell.blade.php +++ b/resources/views/livewire/bell.blade.php @@ -21,7 +21,7 @@
{{ $item->descripcion }}
- @if (!$item->todos || Auth::user()->rol->nombre == 'administrador') + @if (!$item->todos || Auth::user()->rol->nombre == 'administrador' || Auth::user()->rol->nombre == 'super' || Auth::user()->rol->nombre == 'editor') x