create and fix code
This commit is contained in:
@@ -20,15 +20,15 @@ class SupervisorService
|
||||
|
||||
if ($user->hasPermissionTo('show-road-item-supervise-cartable')) {
|
||||
$query = RoadItemsProject::query()
|
||||
->where('is_new', 1)
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
->with('mission:id')
|
||||
->where('is_new', 1);
|
||||
}
|
||||
elseif ($user->hasPermissionTo('show-road-item-supervise-cartable-province')) {
|
||||
throw_if(is_null($user->province_id), new ProhibitedAction('استانی برای شما در سامانه ثبت نشده است!'));
|
||||
$query = RoadItemsProject::query()
|
||||
->with('mission:id')
|
||||
->where('is_new', 1)
|
||||
->where('province_id', auth()->user()->province_id)
|
||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||
->where('province_id', auth()->user()->province_id);
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
@@ -39,7 +39,8 @@ class SupervisorService
|
||||
allowedSelects: [
|
||||
'id', 'province_fa', 'edarat_name', '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'
|
||||
'end_lat', 'end_lng', 'activity_date_time', 'created_at', 'status_fa',
|
||||
'status', 'mission_id'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user