Allow to add Module's fields to the search and filter

This commit is contained in:
Burak Çakırel
2021-09-06 11:15:53 +01:00
parent 332d76b77b
commit 44e3ec8679
4 changed files with 61 additions and 4 deletions

View File

@ -90,7 +90,11 @@ class SearchString extends Component
}
if (isset($options['relationship'])) {
$column .= '.id';
if (isset($options['foreign_key'])) {
$column .= '.' . $options['foreign_key'];
} else {
$column .= '.id';
}
}
return $column;
@ -104,6 +108,10 @@ class SearchString extends Component
$column = str_replace('_code', '', $column);
}
if (!empty($options['translation'])) {
return $options['translation'];
}
if (!empty($options['key'])) {
$column = $options['key'];
}