change the bundle and fix the bugs

This commit is contained in:
2025-06-23 10:12:08 +03:30
parent 4e463de0d3
commit 47dd5afb47
10 changed files with 138 additions and 596 deletions

View File

@@ -9,27 +9,22 @@ use Illuminate\Support\Facades\DB;
class OperatorService
{
public function operatorCartableReport(Request $request, $loadRelations = false)
public function dataTable(Request $request, $loadRelations = false)
{
$allowedFilters = ['*'];
$allowedSortings = ['*'];
$query = RoadPatrol::query()
->select([
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name', 'start_time', 'end_time', 'created_at', 'description',
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
])
->where('operator_id', '=', auth()->user()->id)
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
$data = DataTableFacade::run(
return DataTableFacade::run(
$query,
$request,
allowedFilters: $allowedFilters,
allowedSortings: $allowedSortings);
return $data;
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedSelects: [
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name',
'start_time', 'end_time', 'created_at', 'description',
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
],
);
}
}