diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index 7dba64b..d702441 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -120,7 +120,13 @@ class ShowUsuarios extends Component $consulta_tarifas = TarifaPromo::with('rol')->where('promocion_id', $this->servicio_modTarifas)->get(); } - $this->roles = Role::get(); + if (Auth::user()->rol->nombre == "super") { + + $this->roles = Role::get(); + }else{ + + $this->roles = Role::where('nombre', '=', 'distribuidor')->get(); + } return view('livewire.show-usuarios', [ 'usuarios' => $consulta_usuarios, diff --git a/resources/views/livewire/show-usuarios.blade.php b/resources/views/livewire/show-usuarios.blade.php index dc51520..f390310 100755 --- a/resources/views/livewire/show-usuarios.blade.php +++ b/resources/views/livewire/show-usuarios.blade.php @@ -22,17 +22,27 @@
- + Usuario
- @if (auth()->user()->rol->nombre !== 'administrador' && auth()->user()->rol->nombre !== 'editor') - Añadir + @if (auth()->user()->rol->nombre === 'administrador' || + auth()->user()->rol->nombre === 'editor' || + auth()->user()->rol->nombre === 'super') + Añadir usuario - - + + + @endif + + @if (auth()->user()->rol->nombre === 'super') Mod. tarifas promos. @@ -50,10 +60,16 @@
- - +
@@ -71,29 +87,29 @@ Ventas Saldo @if (auth()->user()->rol->nombre == 'super') - + + @endif - @foreach ($usuarios as $usuario) - - {{$usuario->name ?? '' }} - {{$usuario->email ?? '' }} - {{$usuario->rol->nombre ?? '' }} - {{$usuario->historiales_venta_count ?? '' }} - @if(!empty($usuario->saldo->valor)) - {{number_format($usuario->saldo->valor) ?? '' }} - @else - - @endif + + {{ $usuario->name ?? '' }} + {{ $usuario->email ?? '' }} + {{ $usuario->rol->nombre ?? '' }} + {{ $usuario->historiales_venta_count ?? '' }} + @if (!empty($usuario->saldo->valor)) + {{ number_format($usuario->saldo->valor) ?? '' }} + @else + + @endif - @if (auth()->user()->rol->nombre == 'super') - - - - @endif + @if (auth()->user()->rol->nombre == 'super') + + + - - - - - - -
+ class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10"> + + + + + + + +
+ @endif + @endforeach @@ -143,13 +159,16 @@
+ x-transition:leave-end="opacity-0 scale-100" + class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">

Personalización de precios para {{ $usuario_nombre }}

- +
@@ -237,9 +256,11 @@ @if ($usuarioTarifa->visible !== 'true') - + @else - + @endif ${{ $usuarioTarifa->precio ?? '' }} @@ -589,17 +610,20 @@ Monto a recargar
- +
Tu valor total seria: $

- @php - - $valor_recargar = str_replace([',', '.'], '', $valor_recargar); - @endphp - @if(!empty($valor_recargar)) - {{ number_format((int)$saldo_actual + (int)$valor_recargar) }} + @php + + $valor_recargar = str_replace([',', '.'], '', $valor_recargar); + @endphp + @if (!empty($valor_recargar)) + {{ number_format((int) $saldo_actual + (int) $valor_recargar) }} @else - {{ number_format((int)$saldo_actual)}} + {{ number_format((int) $saldo_actual) }} @endif

@@ -647,7 +671,7 @@ class="border-2 w-1/2 md:w-auto mb-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
Tu valor total seria: $

- {{ number_format((int)$saldo_actual - (int)$valor_recargar) }} + {{ number_format((int) $saldo_actual - (int) $valor_recargar) }}

@@ -693,7 +717,8 @@
- @foreach ($roles as $rol) @@ -703,12 +728,16 @@
- +
- +
@@ -719,7 +748,8 @@ class="border-2 border-neutral-200 focus:ring-0 shadow apperance-none focus:border-neutral-300 text-[#B221FD] leading-tight focus:outline-none focus:shadow-outline">
- +
@@ -750,7 +780,8 @@ {{ number_format($tarifa->precio) ?? 0 }} {{ number_format($tarifa->utilidad) ?? 0 }} - + @endforeach @@ -770,7 +801,11 @@
-
+
@if ($informacionTarifaRol) @@ -779,7 +814,8 @@
- +
@@ -833,14 +870,10 @@
- - - -