select required columns
This commit is contained in:
@@ -19,7 +19,10 @@ class RoadPatrolTableService
|
|||||||
|
|
||||||
if ($user->hasPermissionTo('show-road-patrol-supervise-cartable')) {
|
if ($user->hasPermissionTo('show-road-patrol-supervise-cartable')) {
|
||||||
$query = RoadPatrol::query()
|
$query = RoadPatrol::query()
|
||||||
->select([])
|
->select([
|
||||||
|
'province_fa', 'province_id', 'id', 'edare_id', 'edare_name', 'start_time', 'end_time', 'created_at', 'description',
|
||||||
|
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points,'
|
||||||
|
])
|
||||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||||
}
|
}
|
||||||
elseif ($user->hasPermissionTo('show-road-patrol-supervise-cartable-province')) {
|
elseif ($user->hasPermissionTo('show-road-patrol-supervise-cartable-province')) {
|
||||||
@@ -27,7 +30,10 @@ class RoadPatrolTableService
|
|||||||
return $this->errorResponse('استانی برای شما در سامانه ثبت نشده است!');
|
return $this->errorResponse('استانی برای شما در سامانه ثبت نشده است!');
|
||||||
}
|
}
|
||||||
$query = RoadPatrol::query()
|
$query = RoadPatrol::query()
|
||||||
->select([])
|
->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('province_id', '=', $user->province_id)
|
->where('province_id', '=', $user->province_id)
|
||||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||||
}
|
}
|
||||||
@@ -47,7 +53,10 @@ class RoadPatrolTableService
|
|||||||
$allowedSortings = ['*'];
|
$allowedSortings = ['*'];
|
||||||
|
|
||||||
$query = RoadPatrol::query()
|
$query = RoadPatrol::query()
|
||||||
->select([])
|
->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)
|
->where('operator_id', '=', auth()->user()->id)
|
||||||
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user