From b8d741dddd0657dbc1f4716468b72e223344ee7d Mon Sep 17 00:00:00 2001 From: Juan Felipe Duarte <70235683+DuarteJFelipe@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:40:20 -0700 Subject: [PATCH] vista tabla tarifas y promo dependiendo de cual este abierta --- app/Http/Livewire/ShowTarifas.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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', [