Merge pull request #623 from jitendra-webkul/jitendra

Issue #621 fixed
This commit is contained in:
JItendra Singh 2019-02-26 13:00:35 +05:30 committed by GitHub
commit 8394fc19ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View File

@ -19,13 +19,15 @@ class ProductDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('products_grid as pg')
->leftJoin('products as pr', 'pg.product_id', '=', 'pr.id')
->addSelect('pg.product_id as product_id', 'pg.sku as product_sku', 'pg.name', 'pr.type as product_type', 'pg.status', 'pg.price', 'pg.quantity');
$queryBuilder = DB::table('products_grid')
->leftJoin('products', 'products_grid.product_id', '=', 'products.id')
->leftJoin('attribute_families', 'products.attribute_family_id', '=', 'attribute_families.id')
->addSelect('products_grid.product_id as product_id', 'products_grid.sku as product_sku', 'products_grid.name', 'products.type as product_type', 'products_grid.status', 'products_grid.price', 'products_grid.quantity', 'attribute_families.name as attribute_family');
$this->addFilter('product_id', 'pg.product_id');
$this->addFilter('product_sku', 'pg.sku');
$this->addFilter('product_type', 'pr.type');
$this->addFilter('product_id', 'products_grid.product_id');
$this->addFilter('product_sku', 'products_grid.sku');
$this->addFilter('product_type', 'products.type');
$this->addFilter('attribute_family', 'attribute_families.name');
$this->setQueryBuilder($queryBuilder);
}
@ -57,6 +59,14 @@ class ProductDataGrid extends DataGrid
'sortable' => true
]);
$this->addColumn([
'index' => 'attribute_family',
'label' => trans('admin::app.datagrid.attribute-family'),
'type' => 'string',
'searchable' => true,
'sortable' => true
]);
$this->addColumn([
'index' => 'product_type',
'label' => trans('admin::app.datagrid.type'),

View File

@ -148,6 +148,7 @@ return [
'role' => 'Role',
'sub-total' => 'Sub Total',
'no-of-products' => 'Number of Products',
'attribute-family' => 'Attribute Family'
],
'account' => [