diff --git a/app/Http/Livewire/ShowTarifas.php b/app/Http/Livewire/ShowTarifas.php index 53972de..95a1efa 100644 --- a/app/Http/Livewire/ShowTarifas.php +++ b/app/Http/Livewire/ShowTarifas.php @@ -45,8 +45,13 @@ class ShowTarifas extends Component public function render() { $this->planes = Tarifas::where('servicio_id', $this->servicio_id)->where('rol_id', Auth::user()->rol->id)->where('estado', 'activo')->get(); - // $this->tarifas = Tarifas::where('servicio_id', $this->servicio_id)->where('rol_id', Auth::user()->rol->id)->where('estado', 'activo')->get(); - // $this->tarifas = TarifaPromo::where('promocion_id', $this->promocion_id)->where('rol_id', Auth::user()->rol->id)->where('visible', 'activo')->get(); + + if ($this->modTarifas) { + $this->tarifas = Tarifas::where('servicio_id', $this->servicio_id)->where('rol_id', $this->rol_id)->where('estado', 'activo')->get(); + } + if ($this->modTarifasPromo) { + $this->tarifas = TarifaPromo::where('promocion_id', $this->promocion_id)->where('rol_id', $this->rol_id)->where('visible', 'activo')->get(); + } $this->promociones = TarifaPromo::where('promocion_id', $this->promocion_id)->where('rol_id', Auth::user()->rol->id)->where('visible', 'activo')->get(); return view('livewire.show-tarifas', [