create and fix code

This commit is contained in:
2025-09-08 14:10:03 +03:30
parent 755ab2f67b
commit 52cd049e89
13 changed files with 104 additions and 70 deletions

View File

@@ -21,7 +21,7 @@ class SupervisorService
if ($user->hasPermissionTo('show-road-patrol-supervise-cartable')) {
$query = RoadPatrol::query()
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
->with('mission:id');
}
elseif ($user->hasPermissionTo('show-road-patrol-supervise-cartable-province'))
{
@@ -29,7 +29,7 @@ class SupervisorService
$query = RoadPatrol::query()
->where('province_id', '=', $user->province_id)
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
->with('mission:id');
}
return DataTableFacade::run(
@@ -40,7 +40,8 @@ class SupervisorService
allowedSelects: [
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name',
'start_time', 'end_time', 'created_at', 'description',
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points',
'mission_id'
]
);
}