diff --git a/app/Http/Livewire/ShowConfiguracion.php b/app/Http/Livewire/ShowConfiguracion.php index 3f628ec..f901ba5 100755 --- a/app/Http/Livewire/ShowConfiguracion.php +++ b/app/Http/Livewire/ShowConfiguracion.php @@ -153,10 +153,10 @@ class ShowConfiguracion extends Component $nombreCatalogo = Str::random(10) . '.pdf'; $urlCatalogo = $this->catalogo->storeAs('storage', $nombreCatalogo); } else { - $urlCatalogo = $configuracion->catalogoPDF; + $urlCatalogo = $configuracion->catalogo; } - $configuracion->catalogoPDF = $urlCatalogo; + $configuracion->catalogo = $urlCatalogo; $configuracion->save(); $this->alert('success', 'Catalogo actualizados correctamente!', [ diff --git a/app/Http/Livewire/ShowPromociones.php b/app/Http/Livewire/ShowPromociones.php index d0c7d14..c6674bf 100755 --- a/app/Http/Livewire/ShowPromociones.php +++ b/app/Http/Livewire/ShowPromociones.php @@ -209,7 +209,7 @@ class ShowPromociones extends Component { $this->validate(); - if ($this->cantidad_comprarPromo == 0){ + if ($this->cantidad_comprarPromo == 0) { $this->alert('error', 'La cantidad debe ser mayor a 0', [ 'position' => 'top' ]); @@ -331,21 +331,23 @@ 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]); - if ($cobro) { - $historial->update(['estado' => 'activo']); - $this->modalComprarPromo = false; - $this->credenciales($historial); - } else { - $eliminar = Historial_cuenta::whereIn('id',$this->n)->delete(); + } 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]); + + if ($cobro) { + $historial->update(['estado' => 'activo']); + $this->modalComprarPromo = false; + $this->credenciales($historial); + } else { + $eliminar = Historial_cuenta::whereIn('id', $this->n)->delete(); - $this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [ - 'position' => 'top']); - } + $this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [ + 'position' => 'top' + ]); + } } } diff --git a/app/Models/Configuracione.php b/app/Models/Configuracione.php index c3b4c3f..1a6fd55 100755 --- a/app/Models/Configuracione.php +++ b/app/Models/Configuracione.php @@ -27,7 +27,7 @@ class Configuracione extends Model 'top_8', 'top_9', 'top_10', - + 'img_top', 'mensaje_top', 'premio_1', @@ -40,7 +40,7 @@ class Configuracione extends Model 'premio_8', 'premio_9', 'premio_10', - + 'msj_compra', 'msj_wp', 'clave_1', @@ -52,6 +52,8 @@ class Configuracione extends Model 'iptv', 'hora', 'visto', + + 'catalogo', ]; public function usuario(){ diff --git a/database/migrations/2024_04_27_162654_add_catalogo_to_configuraciones_table.php b/database/migrations/2024_04_27_162654_add_catalogo_to_configuraciones_table.php new file mode 100644 index 0000000..625a87c --- /dev/null +++ b/database/migrations/2024_04_27_162654_add_catalogo_to_configuraciones_table.php @@ -0,0 +1,32 @@ +string('catalogo')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('configuraciones', function (Blueprint $table) { + $table->dropColumn('catalogo'); + }); + } +}; diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php index 6af8ef4..3c808da 100755 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/layouts/navigation.blade.php @@ -1,5 +1,10 @@ {{-- menu lateral --}}
@if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor') + Gestión Planes Importar cuentas @if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador') @@ -91,7 +112,7 @@ Configuración @endif @endif - @endif + @endif