From fc5d11f9a5598bf6af7b777ff75b4826fda0d405 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 16 Feb 2023 17:13:28 +0500 Subject: [PATCH] order kupon filtre --- packages/Sarga/Admin/src/DataGrids/OrderDataGrid.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/Sarga/Admin/src/DataGrids/OrderDataGrid.php b/packages/Sarga/Admin/src/DataGrids/OrderDataGrid.php index 6c68135da..6fda5c84f 100644 --- a/packages/Sarga/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Sarga/Admin/src/DataGrids/OrderDataGrid.php @@ -38,7 +38,7 @@ class OrderDataGrid extends DataGrid $leftJoin->on('order_address_billing.order_id', '=', 'orders.id') ->where('order_address_billing.address_type', OrderAddress::ADDRESS_TYPE_BILLING); }) - ->addSelect('orders.id', 'orders.increment_id', 'orders.sub_total', 'orders.grand_total', 'orders.created_at', 'shipping_title', 'status') + ->addSelect('orders.id', 'orders.increment_id', 'orders.sub_total', 'orders.grand_total', 'orders.created_at', 'shipping_title', 'status','orders.coupon_code') ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_billing.first_name, " ", ' . DB::getTablePrefix() . 'order_address_billing.last_name) as billed_to')) ->addSelect(DB::raw('CONCAT(' . DB::getTablePrefix() . 'order_address_shipping.first_name, " ", ' . DB::getTablePrefix() . 'order_address_shipping.last_name) as shipped_to')); @@ -152,6 +152,15 @@ class OrderDataGrid extends DataGrid 'sortable' => true, 'filterable' => true, ]); + + $this->addColumn([ + 'index' => 'coupon_code', + 'label' => 'Coupon Code', + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + ]); } /**