Skip to content

Commit d3dcfb7

Browse files
committed
Patch: Search by tickets that have all of chosen tags
1 parent 51dc7cf commit d3dcfb7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Controllers/TicketsController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ public function data($ticketList = 'active')
118118
}
119119

120120
if (isset($search_fields['tags'])){
121-
$collection->whereHas('tags', function($query) use($search_fields){
122-
$query->whereIn('id', $search_fields['tags']);
123-
});
121+
foreach ($search_fields['tags'] as $tag_id){
122+
$collection->whereHas('tags', function($q1) use($tag_id){
123+
$q1->where('id', $tag_id);
124+
});
125+
}
124126
}
125127

126128
if (isset($search_fields['comments'])){

0 commit comments

Comments
 (0)