vista tabla tarifas y promo dependiendo de cual este abierta

This commit is contained in:
Juan Felipe Duarte
2025-06-25 16:40:20 -07:00
parent 435b10306d
commit b8d741dddd
+7 -2
View File
@@ -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', [