modify the blades
This commit is contained in:
@@ -60,49 +60,13 @@ class RoadObservationTableService
|
||||
'edarate_shahri.name_fa', 'status', 'status_fa', 'supervisor_description', 'supervising_time'
|
||||
];
|
||||
|
||||
if (auth()->user()->hasPermissionTo('show-fast-react')) {
|
||||
$query = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', '!=', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->whereNotNull('status')
|
||||
->select($fields);
|
||||
}
|
||||
elseif (auth()->user()->hasPermissionTo('show-fast-react-province')) {
|
||||
if (is_null(auth()->user()->province_id)) {
|
||||
return response()->json([
|
||||
'message' => 'استانی برای شما در سامانه ثبت نشده است!'
|
||||
], 400);
|
||||
}
|
||||
|
||||
$query = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_province_id', auth()->user()->province_id)
|
||||
->where('rms_status', '!=', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->whereNotNull('status')
|
||||
->select($fields);
|
||||
}
|
||||
elseif (auth()->user()->hasPermissionTo('show-fast-react-edarate-shahri')) {
|
||||
if (is_null(auth()->user()->edarate_shahri_id)) {
|
||||
return response()->json([
|
||||
'message' => 'اداره ای برای شما در سامانه ثبت نشده است!'
|
||||
], 400);
|
||||
}
|
||||
|
||||
$query = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('edarate_shahri_id', auth()->user()->edarate_shahri_id)
|
||||
->where('rms_status', '!=', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->whereNotNull('status')
|
||||
->select($fields);
|
||||
}
|
||||
|
||||
// $query = RoadObserved::query()
|
||||
// ->where('rms_status', '!=', 0)
|
||||
// ->whereNotNull('road_observeds.province_id')
|
||||
// ->whereNotNull('status')
|
||||
// ->leftJoin('edarate_shahri', 'road_observeds.edarate_shahri_id', '=', 'edarate_shahri.id')
|
||||
// ->where('edarate_shahri_id', $user->edarate_shahri_id)
|
||||
// ->select($fields);
|
||||
$query = RoadObserved::query()
|
||||
->where('rms_status', '!=', 0)
|
||||
->whereNotNull('road_observeds.province_id')
|
||||
->whereNotNull('status')
|
||||
->leftJoin('edarate_shahri', 'road_observeds.edarate_shahri_id', '=', 'edarate_shahri.id')
|
||||
->where('edarate_shahri_id', $user->edarate_shahri_id)
|
||||
->select($fields);
|
||||
|
||||
return DataTableFacade::run(
|
||||
$query,
|
||||
|
||||
Reference in New Issue
Block a user