Minor fix to custom list search scope

This commit is contained in:
Samuel Georges 2016-04-20 05:29:24 +10:00
parent bff35e5f1a
commit 788ffbb417
1 changed files with 4 additions and 1 deletions

View File

@ -1073,7 +1073,10 @@ class Lists extends WidgetBase
$term = $this->searchTerm;
if ($scopeMethod = $this->searchScope) {
$query->$scopeMethod($term);
$searchMethod = $boolean == 'and' ? 'where' : 'orWhere';
$query->$searchMethod(function($q) use ($term, $scopeMethod) {
$q->$scopeMethod($term);
});
}
else {
$searchMethod = $boolean == 'and' ? 'searchWhere' : 'orSearchWhere';