From 897c0cdc2991817f8069eda9897183fc7a6727c2 Mon Sep 17 00:00:00 2001 From: rahul shukla Date: Wed, 10 Mar 2021 19:33:25 +0530 Subject: [PATCH] Rating field added in review datagrid --- .../Admin/src/DataGrids/CustomerReviewDataGrid.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index 33268f8dc..9eaf9f187 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -15,7 +15,7 @@ class CustomerReviewDataGrid extends DataGrid { $queryBuilder = DB::table('product_reviews as pr') ->leftjoin('product_flat as pf', 'pr.product_id', '=', 'pf.product_id') - ->select('pr.id as product_review_id', 'pr.title', 'pr.comment', 'pf.name as product_name', 'pr.status as product_review_status') + ->select('pr.id as product_review_id', 'pr.title', 'pr.comment', 'pf.name as product_name', 'pr.status as product_review_status', 'pr.rating') ->where('channel', core()->getCurrentChannelCode()) ->where('locale', app()->getLocale()); @@ -55,6 +55,15 @@ class CustomerReviewDataGrid extends DataGrid 'filterable' => true, ]); + $this->addColumn([ + 'index' => 'rating', + 'label' => trans('admin::app.customers.reviews.rating'), + 'type' => 'number', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + ]); + $this->addColumn([ 'index' => 'product_name', 'label' => trans('admin::app.datagrid.product-name'),