Skip to content

Commit 94d0aa2

Browse files
authored
Merge pull request #12 from webman-tech/11-amis-搜索默认-clear-后会传递空字符串导致-filter-时所有数据都过滤不到
feature: support amis empty string search
2 parents 917a1d5 + be49616 commit 94d0aa2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Repository/EloquentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ protected function buildSearch(EloquentBuilder $query, array $search): EloquentB
107107
{
108108
$searchableAttributes = $this->searchableAttributes();
109109
foreach ($search as $attribute => $value) {
110-
if (array_key_exists($attribute, $searchableAttributes)) {
110+
if (array_key_exists($attribute, $searchableAttributes) && $value !== '' && $value !== null) {
111111
$query = call_user_func($searchableAttributes[$attribute], $query, $value, $attribute);
112112
}
113113
}

0 commit comments

Comments
 (0)