From 8f92b155be0d44dff804cf17be2857d98ce58b58 Mon Sep 17 00:00:00 2001 From: Felipe Date: Wed, 8 Nov 2023 17:24:20 -0500 Subject: [PATCH 1/2] pendientes fixed --- app/Http/Livewire/ShowPromociones.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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); From 236f7a2714923fbfa7c3fb5cf47d55f37716f1a9 Mon Sep 17 00:00:00 2001 From: Felipe Date: Fri, 10 Nov 2023 15:51:48 -0500 Subject: [PATCH 2/2] super puede eliminar notis --- composer.json | 1 + composer.lock | 38 ++++++++++++------------- resources/views/livewire/bell.blade.php | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) 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 4c26375..0ba3c88 100755 --- 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", @@ -3527,16 +3527,16 @@ }, { "name": "mobiledetect/mobiledetectlib", - "version": "2.8.43", + "version": "2.8.45", "source": { "type": "git", "url": "https://github.com/serbanghita/Mobile-Detect.git", - "reference": "fa96dd52859f03ee2dea002ddd75f8e4e7e9c9da" + "reference": "96aaebcf4f50d3d2692ab81d2c5132e425bca266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/fa96dd52859f03ee2dea002ddd75f8e4e7e9c9da", - "reference": "fa96dd52859f03ee2dea002ddd75f8e4e7e9c9da", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/96aaebcf4f50d3d2692ab81d2c5132e425bca266", + "reference": "96aaebcf4f50d3d2692ab81d2c5132e425bca266", "shasum": "" }, "require": { @@ -3577,7 +3577,7 @@ ], "support": { "issues": "https://github.com/serbanghita/Mobile-Detect/issues", - "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.43" + "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.45" }, "funding": [ { @@ -3585,7 +3585,7 @@ "type": "github" } ], - "time": "2023-11-01T13:40:08+00:00" + "time": "2023-11-07T21:57:25+00:00" }, { "name": "monolog/monolog", @@ -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,5 @@ "php": "^8.0.2" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } 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