From b677624d5d6f6ab0ecadd90e20ca819164c137cc Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sun, 20 Apr 2025 15:54:34 +0330 Subject: [PATCH] debug excel blades --- app/Services/Cartables/RoadItemTableService.php | 2 +- app/Services/DataTable/DataTableService.php | 3 +-- .../v3/Reports/RoadItems/OperatorCartableReport.blade.php | 3 +-- .../v3/Reports/RoadItems/SupervisorCartableReport.blade.php | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Services/Cartables/RoadItemTableService.php b/app/Services/Cartables/RoadItemTableService.php index 0b64e741..2638e5c5 100644 --- a/app/Services/Cartables/RoadItemTableService.php +++ b/app/Services/Cartables/RoadItemTableService.php @@ -53,7 +53,7 @@ class RoadItemTableService $allowedSortings = ['*']; $query = RoadItemsProject::query() - ->select(['id', 'supervisor_description', 'item', 'item_fa', 'sub_item', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng', + ->select(['id', 'province_fa', 'edarat_name', 'supervisor_description', 'item', 'item_fa', 'sub_item', 'sub_item_fa', 'sub_item_data', 'unit_fa', 'start_lat', 'start_lng', 'end_lat', 'end_lng', 'activity_date_time', 'created_at', 'status_fa', 'status']) ->where('is_new', 1) ->where('user_id', auth()->user()->id) diff --git a/app/Services/DataTable/DataTableService.php b/app/Services/DataTable/DataTableService.php index 442f6e48..5755ad1d 100644 --- a/app/Services/DataTable/DataTableService.php +++ b/app/Services/DataTable/DataTableService.php @@ -80,6 +80,7 @@ class DataTableService $query = $this->applySelect($query, $this->allowedSelects); $query = $this->includeRelationsInQuery($query, $this->allowedRelations); + $query = $this->applyGroupBy($query, $this->allowedGroupBy); $this->totalRowCount = $query->count(); @@ -96,8 +97,6 @@ class DataTableService $query = (new ApplySort($query, $sort))->apply(); } - $query = $this->applyGroupBy($query, $this->allowedGroupBy); - return $query; } diff --git a/resources/views/v3/Reports/RoadItems/OperatorCartableReport.blade.php b/resources/views/v3/Reports/RoadItems/OperatorCartableReport.blade.php index 3894defd..76431163 100644 --- a/resources/views/v3/Reports/RoadItems/OperatorCartableReport.blade.php +++ b/resources/views/v3/Reports/RoadItems/OperatorCartableReport.blade.php @@ -97,7 +97,7 @@ {{ $item['sub_item_data'] ? ($item['unit_fa'] ? $item['sub_item_data'] . '(' . $item['unit_fa'] . ')' : $item['sub_item_data'] . '(-)') : '-' }} - {{ $item['cmms_machines'] != null ? $item['cmms_machines']->pluck('machine_code')->implode(', ') : '-' }} + {{ $item['cmmsMachines'] != null ? $item['cmmsMachines']->pluck('machine_code')->implode(', ') : '-' }} {{ $item['rahdaran'] != null ? $item['rahdaran']->pluck('code')->implode(', ') : '-' }} {{ isset($item['start_lat']) && isset($item['start_lng']) ? $item['start_lat'] . ' ' . $item['start_lng'] : '-' }} @@ -114,5 +114,4 @@ - diff --git a/resources/views/v3/Reports/RoadItems/SupervisorCartableReport.blade.php b/resources/views/v3/Reports/RoadItems/SupervisorCartableReport.blade.php index 6203dbbc..d7bb9a9f 100644 --- a/resources/views/v3/Reports/RoadItems/SupervisorCartableReport.blade.php +++ b/resources/views/v3/Reports/RoadItems/SupervisorCartableReport.blade.php @@ -97,7 +97,7 @@ {{ $item['sub_item_data'] ? ($item['unit_fa'] ? $item['sub_item_data'] . '(' . $item['unit_fa'] . ')' : $item['sub_item_data'] . '(-)') : '-' }} - {{ $item['cmms_machines'] != null ? $item['cmms_machines']->pluck('machine_code')->implode(', ') : '-' }} + {{ $item['cmmsMachines'] != null ? $item['cmmsMachines']->pluck('machine_code')->implode(', ') : '-' }} {{ $item['rahdaran'] != null ? $item['rahdaran']->pluck('code')->implode(', ') : '-' }} {{ isset($item['start_lat']) && isset($item['start_lng']) ? $item['start_lat'] . ' ' . $item['start_lng'] : '-' }}