datagrid issue fixes, some column aliases were using underscores due to a bug in symfony it was getting converted into dot, all the aliases are now underscore free
This commit is contained in:
parent
5de07d1b35
commit
e1f7b4deff
|
|
@ -65,73 +65,66 @@ class AttributeDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'attributeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'admin_name',
|
||||
'alias' => 'attributeAdminName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'type',
|
||||
'alias' => 'attributeType',
|
||||
'type' => 'string',
|
||||
'label' => 'Type',
|
||||
'sortable' => false,
|
||||
],
|
||||
[
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'is_required',
|
||||
'alias' => 'attributeIsRequired',
|
||||
'type' => 'string',
|
||||
'label' => 'Required',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'is_unique',
|
||||
'alias' => 'attributeIsUnique',
|
||||
'type' => 'string',
|
||||
'label' => 'Unique',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'value_per_locale',
|
||||
'alias' => 'attributeValuePerLocale',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerLocale',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'value_per_channel',
|
||||
'alias' => 'attributeValuePerChannel',
|
||||
'type' => 'string',
|
||||
'label' => 'ValuePerChannel',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 0)
|
||||
return "False";
|
||||
|
|
|
|||
|
|
@ -68,22 +68,19 @@ class AttributeFamilyDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'attributeFamilyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'attributeFamilyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'attributeFamilyName',
|
||||
'type' => 'string',
|
||||
|
|
@ -98,14 +95,12 @@ class AttributeFamilyDataGrid
|
|||
'alias' => 'attributeFamilyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'attributeFamilyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'attributeFamilyName',
|
||||
'type' => 'string',
|
||||
|
|
@ -120,8 +115,7 @@ class AttributeFamilyDataGrid
|
|||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
|
|
|
|||
|
|
@ -70,33 +70,25 @@ class CategoryDataGrid
|
|||
'columns' => [
|
||||
[
|
||||
'name' => 'cat.id',
|
||||
'alias' => 'cat_id',
|
||||
'alias' => 'catid',
|
||||
'type' => 'number',
|
||||
'label' => 'Category ID',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'ct.name',
|
||||
'alias' => 'cat_name',
|
||||
'alias' => 'catname',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Name',
|
||||
'sortable' => false,
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'cat.position',
|
||||
'alias' => 'cat_position',
|
||||
'alias' => 'catposition',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Position',
|
||||
'sortable' => false,
|
||||
],
|
||||
// [
|
||||
// 'name' => 'cta.name',
|
||||
// 'alias' => 'parent_name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Parent Name',
|
||||
// 'sortable' => true,
|
||||
// ],
|
||||
[
|
||||
'label' => 'Position',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'cat.status',
|
||||
'alias' => 'cat_status',
|
||||
'alias' => 'catstatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Visible in Menu',
|
||||
'sortable' => true,
|
||||
|
|
@ -106,13 +98,12 @@ class CategoryDataGrid
|
|||
else
|
||||
return "True";
|
||||
},
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'ct.locale',
|
||||
'alias' => 'cat_locale',
|
||||
'alias' => 'catlocale',
|
||||
'type' => 'string',
|
||||
'label' => 'Locale',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'filter' => [
|
||||
'function' => 'orWhere',
|
||||
'condition' => ['ct.locale', app()->getLocale()]
|
||||
|
|
@ -123,24 +114,17 @@ class CategoryDataGrid
|
|||
'filterable' => [
|
||||
[
|
||||
'column' => 'cat.id',
|
||||
'alias' => 'cat_id',
|
||||
'alias' => 'catid',
|
||||
'type' => 'number',
|
||||
'label' => 'Category ID',
|
||||
'label' => 'ID',
|
||||
], [
|
||||
'column' => 'ct.name',
|
||||
'alias' => 'cat_name',
|
||||
'alias' => 'catname',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Name',
|
||||
],
|
||||
// [
|
||||
// 'column' => 'cta.name',
|
||||
// 'alias' => 'parentName',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Parent Name',
|
||||
// ],
|
||||
[
|
||||
'label' => 'Name',
|
||||
], [
|
||||
'column' => 'cat.status',
|
||||
'alias' => 'cat_status',
|
||||
'alias' => 'catstatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Visible in Menu',
|
||||
],
|
||||
|
|
@ -152,11 +136,11 @@ class CategoryDataGrid
|
|||
[
|
||||
'column' => 'cat.id',
|
||||
'type' => 'number',
|
||||
'label' => 'Category ID',
|
||||
'label' => 'ID',
|
||||
], [
|
||||
'column' => 'ct.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Category Name',
|
||||
'label' => 'Name',
|
||||
], [
|
||||
'column' => 'cat.status',
|
||||
'type' => 'string',
|
||||
|
|
|
|||
|
|
@ -68,51 +68,50 @@ class ChannelDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'channelID',
|
||||
'type' => 'number',
|
||||
'label' => 'Channel ID',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'channelCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Code',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'hostname',
|
||||
'alias' => 'channelHostName',
|
||||
'type' => 'string',
|
||||
'label' => 'Host Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'channelID',
|
||||
'type' => 'number',
|
||||
'label' => 'Channel ID',
|
||||
],
|
||||
[
|
||||
'label' => 'ID',
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'channelCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Code',
|
||||
],
|
||||
[
|
||||
'label' => 'Code',
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
'label' => 'Name',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
@ -122,12 +121,19 @@ class ChannelDataGrid
|
|||
[
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
],
|
||||
[
|
||||
'label' => 'Name',
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Code',
|
||||
'label' => 'Code',
|
||||
], [
|
||||
'column' => 'hostname',
|
||||
'type' => 'string',
|
||||
'label' => 'Host Name',
|
||||
], [
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -68,29 +68,25 @@ class CountryDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'countryId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'countryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'countryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'status',
|
||||
'alias' => 'countryStatus',
|
||||
'type' => 'number',
|
||||
|
|
@ -101,27 +97,23 @@ class CountryDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'countryId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'countryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'countryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'status',
|
||||
'alias' => 'countryStatus',
|
||||
'type' => 'number',
|
||||
|
|
@ -136,12 +128,19 @@ class CountryDataGrid
|
|||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
], [
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
], [
|
||||
'column' => 'status',
|
||||
'type' => 'number',
|
||||
'label' => 'Code',
|
||||
]
|
||||
],
|
||||
|
||||
//list of viable operators that will be used
|
||||
|
|
|
|||
|
|
@ -74,15 +74,13 @@ class CurrencyDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'currencyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'currencyName',
|
||||
'type' => 'string',
|
||||
|
|
@ -100,14 +98,12 @@ class CurrencyDataGrid
|
|||
'alias' => 'currencyId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'currencyCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'currencyName',
|
||||
'type' => 'string',
|
||||
|
|
@ -119,11 +115,14 @@ class CurrencyDataGrid
|
|||
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'currencyId',
|
||||
'type' => 'number',
|
||||
], [
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
|
|
|
|||
|
|
@ -65,22 +65,19 @@ class CustomerDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'CONCAT(first_name, " ", last_name)',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'email',
|
||||
'alias' => 'Email',
|
||||
'type' => 'string',
|
||||
'label' => 'Email',
|
||||
'sortable' => false,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'customer_group_id',
|
||||
'alias' => 'CustomerGroupId',
|
||||
'type' => 'number',
|
||||
|
|
@ -90,21 +87,18 @@ class CustomerDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
'column' => 'first_name',
|
||||
'alias' => 'FirstName',
|
||||
], [
|
||||
'column' => 'email',
|
||||
'alias' => 'Email',
|
||||
'type' => 'string',
|
||||
'label' => 'First Name',
|
||||
]
|
||||
'label' => 'Email',
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
|
@ -114,11 +108,10 @@ class CustomerDataGrid
|
|||
'column' => 'FirstName',
|
||||
'type' => 'string',
|
||||
'label' => 'First Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'email',
|
||||
'alias' => 'Email',
|
||||
'type' => 'string',
|
||||
'label' => 'Email',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ class CustomerGroupDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'cg.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
|
|
@ -91,6 +90,7 @@ class CustomerGroupDataGrid
|
|||
'sortable' => true,
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
'filterable' => [
|
||||
[
|
||||
|
|
@ -98,8 +98,7 @@ class CustomerGroupDataGrid
|
|||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'cg.id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
|
|
@ -112,8 +111,7 @@ class CustomerGroupDataGrid
|
|||
'column' => 'cg.id',
|
||||
'type' => 'number',
|
||||
'label' => 'Id'
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'cg.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ class ExchangeRatesDataGrid
|
|||
'alias' => 'exchrate',
|
||||
'type' => 'string',
|
||||
'label' => 'Exchange Rate',
|
||||
'sortable' => true
|
||||
],
|
||||
],
|
||||
|
||||
|
|
@ -100,6 +101,11 @@ class ExchangeRatesDataGrid
|
|||
'alias' => 'exchcurrname',
|
||||
'type' => 'string',
|
||||
'label' => 'Currency Name',
|
||||
], [
|
||||
'column' => 'cer.rate',
|
||||
'alias' => 'exchrate',
|
||||
'type' => 'string',
|
||||
'label' => 'Exchange Rate',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
@ -109,6 +115,10 @@ class ExchangeRatesDataGrid
|
|||
'column' => 'exchcurrname',
|
||||
'type' => 'string',
|
||||
'label' => 'Currency Name',
|
||||
], [
|
||||
'column' => 'cer.rate',
|
||||
'type' => 'string',
|
||||
'label' => 'Exchange Rate',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -77,13 +77,13 @@ class InventorySourcesDataGrid
|
|||
'alias' => 'inventoryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'inventoryName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'priority',
|
||||
'alias' => 'inventoryPriority',
|
||||
|
|
@ -114,14 +114,12 @@ class InventorySourcesDataGrid
|
|||
'alias' => 'inventoryID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'inventoryCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'inventoryName',
|
||||
'type' => 'string',
|
||||
|
|
@ -136,11 +134,14 @@ class InventorySourcesDataGrid
|
|||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
], [
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -64,25 +64,21 @@ class LocalesDataGrid
|
|||
// ]
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
//use aliasing as attribute
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'id',
|
||||
'alias' => 'localeId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'code',
|
||||
'alias' => 'localeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'name',
|
||||
'alias' => 'localeName',
|
||||
'type' => 'string',
|
||||
|
|
@ -93,21 +89,18 @@ class LocalesDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'id',
|
||||
'alias' => 'localeId',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'alias' => 'localeCode',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'name',
|
||||
'alias' => 'localeName',
|
||||
'type' => 'string',
|
||||
|
|
@ -116,14 +109,12 @@ class LocalesDataGrid
|
|||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code',
|
||||
|
|
|
|||
|
|
@ -92,10 +92,10 @@ class OrderDataGrid
|
|||
}
|
||||
], [
|
||||
'name' => 'or.created_at',
|
||||
'alias' => 'created_at',
|
||||
'alias' => 'createdat',
|
||||
'type' => 'string',
|
||||
'label' => 'Order Date',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'or.status',
|
||||
'alias' => 'orstatus',
|
||||
|
|
@ -129,11 +129,11 @@ class OrderDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
], [
|
||||
'name' => 'or.status',
|
||||
'column' => 'or.status',
|
||||
'alias' => 'orstatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status'
|
||||
]
|
||||
],
|
||||
],
|
||||
//don't use aliasing in case of searchables
|
||||
|
||||
|
|
@ -142,12 +142,10 @@ class OrderDataGrid
|
|||
'column' => 'or.id',
|
||||
'alias' => 'orderid',
|
||||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
], [
|
||||
'name' => 'or.status',
|
||||
'column' => 'or.status',
|
||||
'alias' => 'orstatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status'
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ class OrderInvoicesDataGrid
|
|||
],
|
||||
|
||||
'join' => [
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
'table' => 'orders as ors',
|
||||
'primaryKey' => 'inv.order_id',
|
||||
'condition' => '=',
|
||||
'secondaryKey' => 'ors.id',
|
||||
]
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'orders as ors',
|
||||
// 'primaryKey' => 'inv.order_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'ors.id',
|
||||
// ]
|
||||
],
|
||||
|
||||
//use aliasing on secodary columns if join is performed
|
||||
|
|
@ -79,24 +79,26 @@ class OrderInvoicesDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'Order ID',
|
||||
'sortable' => true
|
||||
], [
|
||||
'name' => 'inv.state',
|
||||
'alias' => 'invstate',
|
||||
'type' => 'string',
|
||||
'label' => 'State',
|
||||
'sortable' => false
|
||||
], [
|
||||
],
|
||||
// [
|
||||
// 'name' => 'inv.state',
|
||||
// 'alias' => 'invstate',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'State',
|
||||
// 'sortable' => false
|
||||
// ],
|
||||
[
|
||||
'name' => 'inv.grand_total',
|
||||
'alias' => 'invgrandtotal',
|
||||
'type' => 'number',
|
||||
'label' => 'Amount',
|
||||
'sortable' => false
|
||||
'sortable' => true
|
||||
], [
|
||||
'name' => 'inv.created_at',
|
||||
'alias' => 'invcreated_at',
|
||||
'type' => 'date',
|
||||
'label' => 'Invoice Date',
|
||||
'sortable' => false
|
||||
'sortable' => true
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -68,19 +68,19 @@ class OrderShipmentsDataGrid
|
|||
'sortable' => true
|
||||
], [
|
||||
'name' => 'ship.order_id',
|
||||
'alias' => 'order_id',
|
||||
'alias' => 'orderid',
|
||||
'type' => 'number',
|
||||
'label' => 'Order ID',
|
||||
'sortable' => true
|
||||
], [
|
||||
'name' => 'ship.total_qty',
|
||||
'alias' => 'total_qty',
|
||||
'alias' => 'shiptotalqty',
|
||||
'type' => 'number',
|
||||
'label' => 'Total Quantity',
|
||||
'sortable' => true
|
||||
], [
|
||||
'name' => 'CONCAT(ors.customer_first_name, " ", ors.customer_last_name)',
|
||||
'alias' => 'order_customer_first_name',
|
||||
'alias' => 'ordercustomerfirstname',
|
||||
'type' => 'string',
|
||||
'label' => 'Customer Name',
|
||||
'sortable' => false,
|
||||
|
|
@ -92,7 +92,7 @@ class OrderShipmentsDataGrid
|
|||
'sortable' => true
|
||||
], [
|
||||
'name' => 'ship.created_at',
|
||||
'alias' => 'ship_date',
|
||||
'alias' => 'shipdate',
|
||||
'type' => 'string',
|
||||
'label' => 'Shipment Date',
|
||||
'sortable' => false
|
||||
|
|
@ -111,10 +111,9 @@ class OrderShipmentsDataGrid
|
|||
|
||||
'searchable' => [
|
||||
// [
|
||||
// 'column' => 'or.id',
|
||||
// 'alias' => 'orderid',
|
||||
// 'type' => 'number',
|
||||
// 'label' => 'ID',
|
||||
// 'column' => 'ors.customer_first_name',
|
||||
// 'alias' => 'ordercustomerfirstname',
|
||||
// 'type' => 'string',
|
||||
// ]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -71,19 +71,19 @@ class ProductDataGrid
|
|||
'alias' => 'ProductName',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'prods.type',
|
||||
'alias' => 'ProductType',
|
||||
'type' => 'string',
|
||||
'label' => 'Type',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
], [
|
||||
'name' => 'prods.status',
|
||||
'alias' => 'ProductStatus',
|
||||
'type' => 'string',
|
||||
'label' => 'Status',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if($value == 1)
|
||||
return 'Active';
|
||||
|
|
@ -95,13 +95,13 @@ class ProductDataGrid
|
|||
'alias' => 'ProductPrice',
|
||||
'type' => 'string',
|
||||
'label' => 'Price',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
return core()->formatBasePrice($value);
|
||||
},
|
||||
], [
|
||||
'name' => 'prods.attribute_family_name',
|
||||
'alias' => 'product_attribute_family_name',
|
||||
'alias' => 'productattributefamilyname',
|
||||
'type' => 'string',
|
||||
'label' => 'Attribute Family',
|
||||
'sortable' => true,
|
||||
|
|
@ -110,7 +110,7 @@ class ProductDataGrid
|
|||
'alias' => 'ProductQuantity',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Quantity',
|
||||
'sortable' => false,
|
||||
'sortable' => true,
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ class ProductReviewDataGrid
|
|||
//use aliasing on secodary columns if join is performed
|
||||
|
||||
'columns' => [
|
||||
|
||||
[
|
||||
'name' => 'pr.id',
|
||||
'alias' => 'reviewId',
|
||||
|
|
@ -88,15 +87,13 @@ class ProductReviewDataGrid
|
|||
'type' => 'string',
|
||||
'label' => 'Comment',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'pt.name',
|
||||
'alias' => 'productName',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'pr.status',
|
||||
'alias' => 'reviewStatus',
|
||||
'type' => 'number',
|
||||
|
|
@ -134,7 +131,7 @@ class ProductReviewDataGrid
|
|||
'alias' => 'productName',
|
||||
'type' => 'string',
|
||||
'label' => 'Product Name',
|
||||
],[
|
||||
], [
|
||||
'column' => 'pr.status',
|
||||
'alias' => 'reviewStatus',
|
||||
'type' => 'string',
|
||||
|
|
@ -152,6 +149,10 @@ class ProductReviewDataGrid
|
|||
'column' => 'rating',
|
||||
'type' => 'number',
|
||||
'label' => 'Rating',
|
||||
], [
|
||||
'column' => 'pt.name',
|
||||
'alias' => 'productName',
|
||||
'type' => 'string',
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -78,13 +78,7 @@ class SliderDataGrid
|
|||
'alias' => 'sliderTitle',
|
||||
'type' => 'string',
|
||||
'label' => 'title',
|
||||
'sortable' => false
|
||||
], [
|
||||
'name' => 's.channel_id',
|
||||
'alias' => 'channelId',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel ID',
|
||||
'sortable' => false,
|
||||
'sortable' => true
|
||||
], [
|
||||
'name' => 'c.name',
|
||||
'alias' => 'channelName',
|
||||
|
|
@ -106,7 +100,12 @@ class SliderDataGrid
|
|||
'alias' => 'sliderTitle',
|
||||
'type' => 'string',
|
||||
'label' => 'title'
|
||||
],
|
||||
], [
|
||||
'column' => 'c.name',
|
||||
'alias' => 'channelName',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
]
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
|
|
@ -119,6 +118,10 @@ class SliderDataGrid
|
|||
'column' => 's.title',
|
||||
'type' => 'string',
|
||||
'label' => 'Slider Title'
|
||||
], [
|
||||
'column' => 'c.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Channel Name',
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -82,18 +82,13 @@ class TaxCategoryDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name',
|
||||
'sortable' => true,
|
||||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a class="color-red">' . $object->Name . '</a>';
|
||||
// },
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.code',
|
||||
'alias' => 'code',
|
||||
'type' => 'string',
|
||||
|
|
@ -101,6 +96,7 @@ class TaxCategoryDataGrid
|
|||
'sortable' => true,
|
||||
],
|
||||
],
|
||||
|
||||
//don't use aliasing in case of filters
|
||||
'filterable' => [
|
||||
[
|
||||
|
|
@ -108,28 +104,26 @@ class TaxCategoryDataGrid
|
|||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'ID'
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'tr.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'tr.code',
|
||||
'alias' => 'code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code'
|
||||
]
|
||||
],
|
||||
|
||||
//don't use aliasing in case of searchables
|
||||
'searchable' => [
|
||||
[
|
||||
'column' => 'tr.code',
|
||||
'type' => 'string',
|
||||
'label' => 'Code'
|
||||
],
|
||||
[
|
||||
], [
|
||||
'column' => 'tr.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
|
|
|
|||
|
|
@ -73,8 +73,7 @@ class TaxRateDataGrid
|
|||
'type' => 'number',
|
||||
'label' => 'ID',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.identifier',
|
||||
'alias' => 'identifier',
|
||||
'type' => 'string',
|
||||
|
|
@ -83,25 +82,21 @@ class TaxRateDataGrid
|
|||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a class="color-red">' . $object->identifier . '</a>';
|
||||
// },
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.state',
|
||||
'alias' => 'state',
|
||||
'type' => 'string',
|
||||
'label' => 'State',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.country',
|
||||
'alias' => 'country',
|
||||
'type' => 'string',
|
||||
'label' => 'Country',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
[
|
||||
], [
|
||||
'name' => 'tr.tax_rate',
|
||||
'alias' => 'tax_rate',
|
||||
'alias' => 'taxrate',
|
||||
'type' => 'number',
|
||||
'label' => 'Tax Rate',
|
||||
'sortable' => true,
|
||||
|
|
@ -131,7 +126,7 @@ class TaxRateDataGrid
|
|||
'label' => 'Country',
|
||||
], [
|
||||
'column' => 'tr.tax_rate',
|
||||
'alias' => 'tax_rate',
|
||||
'alias' => 'taxrate',
|
||||
'type' => 'number',
|
||||
'label' => 'Tax Rate',
|
||||
],
|
||||
|
|
@ -142,6 +137,18 @@ class TaxRateDataGrid
|
|||
'column' => 'tr.identifier',
|
||||
'type' => 'string',
|
||||
'label' => 'Identifier',
|
||||
], [
|
||||
'column' => 'tr.state',
|
||||
'type' => 'string',
|
||||
'label' => 'State',
|
||||
], [
|
||||
'column' => 'tr.country',
|
||||
'type' => 'string',
|
||||
'label' => 'Country',
|
||||
], [
|
||||
'column' => 'tr.tax_rate',
|
||||
'type' => 'number',
|
||||
'label' => 'Tax Rate',
|
||||
],
|
||||
],
|
||||
'operators' => [
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ class UserDataGrid
|
|||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a class="color-red">' . $object->ID . '</a>';
|
||||
// },
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'u.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
|
|
@ -97,38 +96,43 @@ class UserDataGrid
|
|||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a class="color-red">' . $object->Name . '</a>';
|
||||
// },
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'u.email',
|
||||
'alias' => 'Email',
|
||||
'type' => 'string',
|
||||
'label' => 'Email',
|
||||
'sortable' => true,
|
||||
],
|
||||
[
|
||||
], [
|
||||
'name' => 'r.name',
|
||||
'alias' => 'xa',
|
||||
'alias' => 'rolename',
|
||||
'type' => 'string',
|
||||
'label' => 'Role Name',
|
||||
'sortable' => true,
|
||||
],
|
||||
|
||||
],
|
||||
//don't use aliasing in case of filters
|
||||
'filterable' => [
|
||||
[
|
||||
'column' => 'u.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
],
|
||||
[
|
||||
'column' => 'u.id',
|
||||
'alias' => 'ID',
|
||||
'type' => 'number',
|
||||
'label' => 'Admin ID'
|
||||
],
|
||||
|
||||
], [
|
||||
'column' => 'u.name',
|
||||
'alias' => 'Name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
], [
|
||||
'column' => 'u.email',
|
||||
'alias' => 'Email',
|
||||
'type' => 'string',
|
||||
'label' => 'Email',
|
||||
], [
|
||||
'column' => 'r.name',
|
||||
'alias' => 'rolename',
|
||||
'type' => 'string',
|
||||
'label' => 'Role Name',
|
||||
]
|
||||
],
|
||||
//don't use aliasing in case of searchables
|
||||
'searchable' => [
|
||||
|
|
@ -140,6 +144,14 @@ class UserDataGrid
|
|||
'column' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Name'
|
||||
], [
|
||||
'column' => 'u.email',
|
||||
'type' => 'string',
|
||||
'label' => 'Email',
|
||||
], [
|
||||
'column' => 'r.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Role Name',
|
||||
]
|
||||
],
|
||||
'operators' => [
|
||||
|
|
|
|||
Loading…
Reference in New Issue