Skip to content

Commit a87e32b

Browse files
authored
Merge pull request #104 from n1crack/dev
fix individual filter
2 parents de67860 + 35e4a64 commit a87e32b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/QueryBuilder.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,16 @@ protected function filter(Query $query): string
218218
*/
219219
protected function filterGlobal(Query $query): string
220220
{
221-
$searchinput = preg_replace("/\W+/u", ' ', $this->options->searchValue());
221+
$searchInput = preg_replace("/\W+/u", ' ', $this->options->searchValue());
222222
$columns = $this->columns->searchable();
223223

224-
if ($searchinput === null || $searchinput === '' || \count($columns) === 0) {
224+
if ($searchInput === null || $searchInput === '' || \count($columns) === 0) {
225225
return '';
226226
}
227227

228228
$search = [];
229229

230-
foreach (explode(' ', $searchinput) as $word) {
230+
foreach (explode(' ', $searchInput) as $word) {
231231
$look = [];
232232

233233
foreach ($columns as $column) {
@@ -253,6 +253,8 @@ protected function filterIndividual(Query $query): string
253253
$look[] = $this->columnFilter($column, new FilterHelper($query, $column, $this->db));
254254
}
255255

256+
$look = array_filter($look);
257+
256258
return implode(' AND ', $look);
257259
}
258260

@@ -325,4 +327,4 @@ public function columnFilter(Column $column, FilterHelper $helper): string
325327

326328
return $helper->defaultFilter();
327329
}
328-
}
330+
}

0 commit comments

Comments
 (0)