set index as abstract method changed to protected property
This commit is contained in:
parent
9aa55472ab
commit
0607a9e818
|
|
@ -30,7 +30,7 @@ return [
|
|||
*
|
||||
* Accepted Value = integer
|
||||
*/
|
||||
'paginate' => true,
|
||||
'paginate' => false,
|
||||
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ use DB;
|
|||
*/
|
||||
class AttributeDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
protected $itemsPerPage = 5; //overriding the default items per page
|
||||
|
||||
protected $index = 'id'; //the column that needs to be treated as index column
|
||||
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
|
|
@ -25,11 +25,6 @@ class AttributeDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex()
|
||||
{
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
{
|
||||
protected $itemsPerPage = 5;
|
||||
|
||||
protected $index = 'id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('attribute_families')->select('id')->addSelect('id', 'code', 'name');
|
||||
|
|
@ -22,10 +24,6 @@ class AttributeFamilyDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class CategoryDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'category_id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('categories as cat')->select('cat.id as category_id', 'ct.name as category_name', 'cat.position as category_position', 'cat.status as category_status', 'ct.locale as category_locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id');
|
||||
|
|
@ -20,10 +22,6 @@ class CategoryDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'category_id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class ChannelDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('channels')->addSelect('id', 'code', 'name', 'hostname');
|
||||
|
|
@ -20,10 +22,6 @@ class ChannelDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class CurrencyDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('currencies')->addSelect('id', 'name', 'code');
|
||||
|
|
@ -20,10 +22,6 @@ class CurrencyDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ class CustomerDataGrid extends DataGrid
|
|||
{
|
||||
protected $itemsPerPage = 5;
|
||||
|
||||
protected $index = 'customer_id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('customers as cus')->addSelect('cus.id as customer_id', 'cus.email as customer_email', 'cg.name as customer_group_name')->addSelect(DB::raw('CONCAT(cus.first_name, " ", cus.last_name) as customer_full_name'))->leftJoin('customer_groups as cg', 'cus.customer_group_id', '=', 'cg.id');
|
||||
|
|
@ -22,10 +24,6 @@ class CustomerDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'customer_id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class CustomerGroupDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('customer_groups')->addSelect('id', 'name');
|
||||
|
|
@ -20,10 +22,6 @@ class CustomerGroupDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class CustomerReviewDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'product_review_id'; //the column that needs to be treated as index column
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id as product_review_id', 'pr.title as product_review_title', 'pr.comment as product_review_comment', 'pg.name as product_review_name', 'pr.status as product_review_status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id');
|
||||
|
|
@ -20,10 +22,6 @@ class CustomerReviewDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'product_review_id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class ExchangeRatesDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'currency_exch_id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id as currency_exch_id', 'curr.name as currency_exch_name', 'cer.rate as currency_exch_rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id');
|
||||
|
|
@ -20,10 +22,6 @@ class ExchangeRatesDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'currency_exch_id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class InventorySourcesDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('inventory_sources')->addSelect('id', 'code', 'name', 'priority', 'status');
|
||||
|
|
@ -20,10 +22,6 @@ class InventorySourcesDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class LocalesDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('locales')->addSelect('id', 'code', 'name');
|
||||
|
|
@ -20,10 +22,6 @@ class LocalesDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class NewsLetterDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('subscribers_list')->addSelect('id', 'is_subscribed', 'email');
|
||||
|
|
@ -20,10 +22,6 @@ class NewsLetterDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class OrderDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as full_name'));
|
||||
|
|
@ -20,10 +22,6 @@ class OrderDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class OrderInvoicesDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('invoices')->select('id', 'order_id', 'state', 'grand_total', 'created_at');
|
||||
|
|
@ -20,10 +22,6 @@ class OrderInvoicesDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class OrderShipmentsDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'shipment_id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('shipments as ship')->select('ship.id as shipment_id', 'ship.order_id as shipment_order_id', 'ship.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'ship.created_at as shipment_created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id');
|
||||
|
|
@ -20,10 +22,6 @@ class OrderShipmentsDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'shipment_id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class ProductDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'product_id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id as product_id', 'products_grid.sku as product_sku', 'products_grid.name as product_name', 'products.type as product_type', 'products_grid.status as product_status', 'products_grid.price as product_price', 'products_grid.quantity as product_quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id');
|
||||
|
|
@ -20,14 +22,6 @@ class ProductDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'product_id'; //the column that needs to be treated as index column
|
||||
}
|
||||
|
||||
// public function setGridName() {
|
||||
// $this->gridName = 'products_grid'; // should be the table name for getting proper index
|
||||
// }
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class RolesDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('roles')->addSelect('id', 'name', 'permission_type');
|
||||
|
|
@ -20,10 +22,6 @@ class RolesDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class SliderDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'slider_id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('sliders as sl')->addSelect('sl.id as slider_id', 'sl.title as slider_title', 'ch.name as channel_name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id');
|
||||
|
|
@ -20,10 +22,6 @@ class SliderDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'slider_id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class TaxCategoryDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('tax_categories')->addSelect('id', 'name', 'code');
|
||||
|
|
@ -20,10 +22,6 @@ class TaxCategoryDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class TaxRateDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('tax_rates')->addSelect('id', 'identifier', 'state', 'country', 'tax_rate');
|
||||
|
|
@ -20,10 +22,6 @@ class TaxRateDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
@ -64,7 +62,7 @@ class TaxRateDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'tax_rate',
|
||||
'label' => trans('admin::app.datagrid.rate'),
|
||||
'label' => trans('admin::app.datagrid.tax-rate'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ use DB;
|
|||
*/
|
||||
class UserDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'user_id';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('admins as u')->addSelect('u.id as user_id', 'u.name as user_name', 'u.status as user_status', 'u.email as user_email', 'ro.name as role_name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id');
|
||||
|
|
@ -20,10 +22,6 @@ class UserDataGrid extends DataGrid
|
|||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function setIndex() {
|
||||
$this->index = 'user_id';
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ abstract class DataGrid
|
|||
|
||||
abstract public function prepareQueryBuilder();
|
||||
abstract public function addColumns();
|
||||
abstract public function setIndex();
|
||||
|
||||
/**
|
||||
* Parse the URL and get it ready to be used.
|
||||
|
|
@ -186,8 +185,6 @@ abstract class DataGrid
|
|||
{
|
||||
$this->addColumns();
|
||||
|
||||
$this->setIndex();
|
||||
|
||||
$this->prepareActions();
|
||||
|
||||
$this->prepareMassActions();
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@
|
|||
<thead v-if="massActionsToggle">
|
||||
@if(isset($results['massactions']))
|
||||
<tr class="mass-action" style="height: 63px;" v-if="massActionsToggle">
|
||||
<th colspan="100" style="width: 100%;">
|
||||
<th colspan="10" style="width: 100%;">
|
||||
<div class="mass-action-wrapper" style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;">
|
||||
|
||||
<span class="massaction-remove" v-on:click="removeMassActions" style="margin-right: 10px;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue