Added suspend filter for customers

This commit is contained in:
sanjeev 2022-09-08 16:31:43 +05:30
parent e475245a5d
commit 526131e2ed
4 changed files with 24 additions and 2 deletions

View File

@ -56,6 +56,7 @@ class CustomerDataGrid extends DataGrid
$this->addFilter('phone', 'customers.phone'); $this->addFilter('phone', 'customers.phone');
$this->addFilter('gender', 'customers.gender'); $this->addFilter('gender', 'customers.gender');
$this->addFilter('status', 'status'); $this->addFilter('status', 'status');
$this->addFilter('is_suspended', 'customers.is_suspended');
$this->setQueryBuilder($queryBuilder); $this->setQueryBuilder($queryBuilder);
} }
@ -158,6 +159,25 @@ class CustomerDataGrid extends DataGrid
return $html; return $html;
}, },
]); ]);
$this->addColumn([
'index' => 'is_suspended',
'label' => trans('admin::app.customers.customers.suspended'),
'type' => 'boolean',
'searchable' => false,
'sortable' => true,
'filterable' => true,
'visibility' => false,
'closure' => function ($row) {
$html = '';
if ($row->is_suspended) {
$html .= '<span class="badge badge-md badge-danger">' . trans('admin::app.customers.customers.suspended') . '</span>';
}
return $html;
},
]);
} }
/** /**

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{ {
"/js/ui.js": "/js/ui.js?id=2effb6ad469c2b8c5af2", "/js/ui.js": "/js/ui.js?id=c205c15cc83b8bb70232",
"/css/ui.css": "/css/ui.css?id=933372010d246f94f931" "/css/ui.css": "/css/ui.css?id=933372010d246f94f931"
} }

View File

@ -118,6 +118,7 @@
<th <th
:key="columnKey" :key="columnKey"
v-for="(column, columnKey) in columns" v-for="(column, columnKey) in columns"
v-if ="column.visibility != false"
v-text="column.label" v-text="column.label"
class="grid_head" class="grid_head"
:class="{ sortable: column.sortable }" :class="{ sortable: column.sortable }"
@ -160,6 +161,7 @@
<td <td
:key="columnKey" :key="columnKey"
v-for="(column, columnKey) in columns" v-for="(column, columnKey) in columns"
v-if ="column.visibility != false"
v-html="record[column.index]" v-html="record[column.index]"
:data-value="column.label" :data-value="column.label"
></td> ></td>