This commit is contained in:
Prashant Singh 2019-03-19 12:13:17 +05:30
parent e3277878bf
commit 40a0fa8cb0
3 changed files with 9 additions and 7 deletions

View File

@ -28,13 +28,14 @@ class OrderDataGrid extends DataGrid
$leftJoin->on('order_address_billing.order_id', '=', 'orders.id')
->where('order_address_billing.address_type', 'billing');
})
->addSelect('orders.id', 'base_sub_total', 'base_grand_total', 'orders.created_at', 'channel_name', 'status')
->addSelect('orders.id', 'orders.base_sub_total', 'orders.base_grand_total', 'orders.created_at', 'channel_name', 'status')
->addSelect(DB::raw('CONCAT(order_address_billing.first_name, " ", order_address_billing.last_name) as billed_to'))
->addSelect(DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name) as shipped_to'));
$this->addFilter('billed_to', DB::raw('CONCAT(order_address_billing.first_name, " ", order_address_billing.last_name)'));
$this->addFilter('shipped_to', DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name)'));
$this->addFilter('id', 'orders.id');
$this->addFilter('created_at', 'orders.created_at');
$this->setQueryBuilder($queryBuilder);
}

View File

@ -26,14 +26,14 @@ class OrderShipmentsDataGrid extends DataGrid
})
->leftJoin('orders as ors', 'shipments.order_id', '=', 'ors.id')
->leftJoin('inventory_sources as is', 'shipments.inventory_source_id', '=', 'is.id')
->select('shipments.id as shipment_id', 'shipments.order_id as shipment_order_id', 'shipments.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as orderdate', 'shipments.created_at as shipment_created_at')
->select('shipments.id as shipment_id', 'shipments.order_id as shipment_order_id', 'shipments.total_qty as shipment_total_qty', 'is.name as inventory_source_name', 'ors.created_at as order_date', 'shipments.created_at as shipment_created_at')
->addSelect(DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name) as shipped_to'));
$this->addFilter('shipment_id', 'shipments.id');
$this->addFilter('shipment_order_id', 'shipments.order_id');
$this->addFilter('shipment_total_qty', 'shipments.total_qty');
$this->addFilter('inventory_source_name', 'is.name');
$this->addFilter('orderdate', 'ors.created_at');
$this->addFilter('order_date', 'ors.created_at');
$this->addFilter('shipment_created_at', 'shipments.created_at');
$this->addFilter('shipped_to', DB::raw('CONCAT(order_address_shipping.first_name, " ", order_address_shipping.last_name)'));
@ -79,7 +79,7 @@ class OrderShipmentsDataGrid extends DataGrid
]);
$this->addColumn([
'index' => 'orderdate',
'index' => 'order_date',
'label' => trans('admin::app.datagrid.order-date'),
'type' => 'datetime',
'sortable' => true,

View File

@ -24,11 +24,12 @@ class ProductDataGrid extends DataGrid
$queryBuilder = DB::table('products_grid')
->leftJoin('products', 'products_grid.product_id', '=', 'products.id')
->leftJoin('attribute_families', 'products.attribute_family_id', '=', 'attribute_families.id')
->select('products_grid.product_id as product_id', 'products_grid.sku as product_sku', 'products_grid.name as productname', 'products.type as product_type', 'products_grid.status', 'products_grid.price', 'products_grid.quantity', 'attribute_families.name as attribute_family');
->select('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', 'products_grid.price', 'products_grid.quantity', 'attribute_families.name as attribute_family');
$this->addFilter('product_id', 'products_grid.product_id');
$this->addFilter('productname', 'products_grid.name');
$this->addFilter('product_name', 'products_grid.name');
$this->addFilter('product_sku', 'products_grid.sku');
$this->addFilter('status', 'products_grid.status');
$this->addFilter('product_type', 'products.type');
$this->addFilter('attribute_family', 'attribute_families.name');
@ -57,7 +58,7 @@ class ProductDataGrid extends DataGrid
]);
$this->addColumn([
'index' => 'productname',
'index' => 'product_name',
'label' => trans('admin::app.datagrid.name'),
'type' => 'string',
'searchable' => true,