mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
filters corrected
This commit is contained in:
@@ -104,6 +104,10 @@ class LibraryTable extends Component
|
||||
->where('libraries.name', $this->currentTab)
|
||||
)
|
||||
)
|
||||
->when(isset($this->filters['lecturer_id']),
|
||||
fn($query) => $query->where('library_items.lecturer_id',
|
||||
$this->filters['lecturer_id'])
|
||||
)
|
||||
->when(isset($this->filters['tag']), fn($query) => $query->whereHas('tags',
|
||||
fn($query) => $query->whereIn('tags.id', $this->filters['tag'])))
|
||||
->when(isset($this->filters['language']),
|
||||
|
||||
@@ -85,7 +85,7 @@ class LecturerTable extends DataTableComponent
|
||||
return Lecturer::query()
|
||||
->withCount([
|
||||
'courses',
|
||||
'libraryItems',
|
||||
'libraryItems' => fn($query) => $query->where('news', false)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -108,11 +108,9 @@ class LecturerTable extends DataTableComponent
|
||||
return to_route('library.table.libraryItems', [
|
||||
'#table',
|
||||
'country' => $this->country,
|
||||
'library_items' => [
|
||||
'filters' => [
|
||||
'lecturer_id' => $lecturer->id,
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user