Search string add key for label
This commit is contained in:
parent
afbced2e0c
commit
34b59de01c
@ -52,7 +52,7 @@ class SearchString extends Component
|
|||||||
|
|
||||||
$this->filters[] = [
|
$this->filters[] = [
|
||||||
'key' => $this->getFilterKey($column, $options),
|
'key' => $this->getFilterKey($column, $options),
|
||||||
'value' => $this->getFilterName($column),
|
'value' => $this->getFilterName($column, $options),
|
||||||
'type' => $this->getFilterType($options),
|
'type' => $this->getFilterType($options),
|
||||||
'url' => $this->getFilterUrl($column, $options),
|
'url' => $this->getFilterUrl($column, $options),
|
||||||
'values' => $this->getFilterValues($column, $options),
|
'values' => $this->getFilterValues($column, $options),
|
||||||
@ -83,7 +83,7 @@ class SearchString extends Component
|
|||||||
return $column;
|
return $column;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFilterName($column)
|
protected function getFilterName($column, $options)
|
||||||
{
|
{
|
||||||
if (strpos($column, '_id') !== false) {
|
if (strpos($column, '_id') !== false) {
|
||||||
$column = str_replace('_id', '', $column);
|
$column = str_replace('_id', '', $column);
|
||||||
@ -91,6 +91,10 @@ class SearchString extends Component
|
|||||||
$column = str_replace('_code', '', $column);
|
$column = str_replace('_code', '', $column);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($options['key'])) {
|
||||||
|
$column = $options['key'];
|
||||||
|
}
|
||||||
|
|
||||||
$plural = Str::plural($column, 2);
|
$plural = Str::plural($column, 2);
|
||||||
|
|
||||||
if (trans_choice('general.' . $plural, 1) !== 'general.' . $plural) {
|
if (trans_choice('general.' . $plural, 1) !== 'general.' . $plural) {
|
||||||
|
@ -188,7 +188,10 @@ return [
|
|||||||
'document_number' => ['searchable' => true],
|
'document_number' => ['searchable' => true],
|
||||||
'order_number' => ['searchable' => true],
|
'order_number' => ['searchable' => true],
|
||||||
'status',
|
'status',
|
||||||
'issued_at' => ['date' => true],
|
'issued_at' => [
|
||||||
|
'key' => 'billed_at',
|
||||||
|
'date' => true,
|
||||||
|
],
|
||||||
'due_at' => ['date' => true],
|
'due_at' => ['date' => true],
|
||||||
'amount',
|
'amount',
|
||||||
'currency_code' => [
|
'currency_code' => [
|
||||||
@ -231,7 +234,10 @@ return [
|
|||||||
'document_number' => ['searchable' => true],
|
'document_number' => ['searchable' => true],
|
||||||
'order_number' => ['searchable' => true],
|
'order_number' => ['searchable' => true],
|
||||||
'status',
|
'status',
|
||||||
'issued_at' => ['date' => true],
|
'issued_at' => [
|
||||||
|
'key' => 'invoiced_at',
|
||||||
|
'date' => true,
|
||||||
|
],
|
||||||
'due_at' => ['date' => true],
|
'due_at' => ['date' => true],
|
||||||
'amount',
|
'amount',
|
||||||
'currency_code' => [
|
'currency_code' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user