diff --git a/app/Member/FilterScope.php b/app/Member/FilterScope.php index 546b5394..4442563a 100644 --- a/app/Member/FilterScope.php +++ b/app/Member/FilterScope.php @@ -19,8 +19,8 @@ class FilterScope extends Filter public function __construct( public bool $ausstand = false, public ?string $billKind = null, - public ?int $activityId = null, - public ?int $subactivityId = null, + public array $activityIds = [], + public array $subactivityIds = [], public string $search = '', public ?int $groupId = null, ) { @@ -53,14 +53,14 @@ class FilterScope extends Filter $query->where('group_id', $this->groupId); } - if ($this->subactivityId || $this->activityId) { + if (count($this->subactivityIds) + count($this->activityIds) > 0) { $query->whereHas('memberships', function ($q) { $q->active(); - if ($this->subactivityId) { - $q->where('subactivity_id', $this->subactivityId); + if (count($this->subactivityIds)) { + $q->whereIn('subactivity_id', $this->subactivityIds); } - if ($this->activityId) { - $q->where('activity_id', $this->activityId); + if (count($this->activityIds)) { + $q->whereIn('activity_id', $this->activityIds); } }); } diff --git a/resources/js/components/form/Multipleselect.vue b/resources/js/components/form/Multipleselect.vue new file mode 100644 index 00000000..d4d00cfa --- /dev/null +++ b/resources/js/components/form/Multipleselect.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/resources/js/views/member/VIndex.vue b/resources/js/views/member/VIndex.vue index 0e1750b1..fc1ba875 100644 --- a/resources/js/views/member/VIndex.vue +++ b/resources/js/views/member/VIndex.vue @@ -33,24 +33,24 @@ label="Rechnung" size="sm" > - - + + name="subactivity_ids" + >