remove mission relation from cartables
This commit is contained in:
@@ -11,7 +11,6 @@ class OperatorService
|
||||
public function dataTable(Request $request, $loadRelations = false)
|
||||
{
|
||||
$query = RoadItemsProject::query()
|
||||
->with('mission:id')
|
||||
->where('is_new', '=', 1)
|
||||
->where('user_id', '=', auth()->user()->id);
|
||||
|
||||
|
||||
@@ -20,13 +20,11 @@ class SupervisorService
|
||||
|
||||
if ($user->hasPermissionTo('show-road-item-supervise-cartable')) {
|
||||
$query = RoadItemsProject::query()
|
||||
->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);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ class OperatorService
|
||||
public function dataTable(Request $request, $loadRelations = false)
|
||||
{
|
||||
$query = RoadPatrol::query()
|
||||
->with('mission:id')
|
||||
->where('operator_id', '=', auth()->user()->id);
|
||||
|
||||
return DataTableFacade::run(
|
||||
|
||||
@@ -20,16 +20,14 @@ class SupervisorService
|
||||
$query = null;
|
||||
|
||||
if ($user->hasPermissionTo('show-road-patrol-supervise-cartable')) {
|
||||
$query = RoadPatrol::query()
|
||||
->with('mission:id');
|
||||
$query = RoadPatrol::query();
|
||||
}
|
||||
elseif ($user->hasPermissionTo('show-road-patrol-supervise-cartable-province'))
|
||||
{
|
||||
throw_if(is_null($user->province_id), new ProhibitedAction('استانی برای شما در سامانه ثبت نشده است!'));
|
||||
|
||||
$query = RoadPatrol::query()
|
||||
->where('province_id', '=', $user->province_id)
|
||||
->with('mission:id');
|
||||
->where('province_id', '=', $user->province_id);
|
||||
}
|
||||
|
||||
return DataTableFacade::run(
|
||||
|
||||
Reference in New Issue
Block a user