create complaints blade

This commit is contained in:
2025-02-25 15:03:30 +03:30
parent 2adf091f7d
commit d0c9908e6c
6 changed files with 204 additions and 24 deletions

View File

@@ -26,7 +26,8 @@ class RoadObservationTableService
if ($user->hasPermissionTo('supervise-fast-react')) {
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
->whereNotNull('road_observeds.status');
->whereNotNull('road_observeds.status')
->select($fields);
}
elseif ($user->hasPermissionTo('supervise-fast-react-province'))
{
@@ -37,7 +38,8 @@ class RoadObservationTableService
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
->where('road_observeds.province_id', $user->province_id)
->whereNotNull('road_observeds.status');
->whereNotNull('road_observeds.status')
->select($fields);
}
return DataTableFacade::run(
@@ -96,7 +98,10 @@ class RoadObservationTableService
if ($user->hasPermissionTo('show-fast-react')) {
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
->where('rms_status', '=', 0)
->whereNotNull('edarate_shahri_id');
->whereNotNull('edarate_shahri_id')
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
status_fa, supervisor_description, rms_description, province_fa, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng');
}
elseif ($user->hasPermissionTo('show-fast-react-province')) {
@@ -106,8 +111,11 @@ class RoadObservationTableService
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
->where('rms_status', '=', 0)
->whereNotNull('edarate_shahri_id')
->where('road_observeds.province_id', '=', $user->province_id);
->whereNotNull('road_observeds.province_id')
->where('road_observeds.province_id', '=', $user->province_id)
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
status_fa, supervisor_description, rms_description, province_fa, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng');
}
elseif ($user->hasPermissionTo('show-fast-react-edarate-shahri')) {
@@ -119,7 +127,10 @@ class RoadObservationTableService
$query = RoadObserved::query()->leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
->where('rms_status', '=', 0)
->whereNotNull('edarate_shahri_id')
->where('edarate_shahri_id', '=', $user->edarate_shahri_id);
->where('edarate_shahri_id', '=', $user->edarate_shahri_id)
->selectRaw('fk_RegisteredEventMessage, road_observeds.id, Title, FeatureTypeTitle, MobileForSendEventSms,
road_observeds.created_at, rms_last_activity, rms_last_activity_fa, status,
status_fa, supervisor_description, rms_description, province_fa, city_fa, Description, edarate_shahri.name_fa as edarate_shahri_name_fa, lat, lng');
}

View File

@@ -21,7 +21,7 @@ class RoadPatrolTableService
$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,'
'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']));
}
@@ -32,7 +32,7 @@ class RoadPatrolTableService
$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,'
'distance', 'vehicle_runtime', 'fuel_consumption', 'stop_points'
])
->where('province_id', '=', $user->province_id)
->when($loadRelations, fn ($query) => $query->with(['rahdaran:id,name,code', 'cmmsMachines:id,machine_code,car_name,plak_number']));
@@ -55,7 +55,7 @@ class RoadPatrolTableService
$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,'
'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']));