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)
|
->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',
|
->when(isset($this->filters['tag']), fn($query) => $query->whereHas('tags',
|
||||||
fn($query) => $query->whereIn('tags.id', $this->filters['tag'])))
|
fn($query) => $query->whereIn('tags.id', $this->filters['tag'])))
|
||||||
->when(isset($this->filters['language']),
|
->when(isset($this->filters['language']),
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class LecturerTable extends DataTableComponent
|
|||||||
return Lecturer::query()
|
return Lecturer::query()
|
||||||
->withCount([
|
->withCount([
|
||||||
'courses',
|
'courses',
|
||||||
'libraryItems',
|
'libraryItems' => fn($query) => $query->where('news', false)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,10 +108,8 @@ class LecturerTable extends DataTableComponent
|
|||||||
return to_route('library.table.libraryItems', [
|
return to_route('library.table.libraryItems', [
|
||||||
'#table',
|
'#table',
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'library_items' => [
|
'filters' => [
|
||||||
'filters' => [
|
'lecturer_id' => $lecturer->id,
|
||||||
'lecturer_id' => $lecturer->id,
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user