show related harim
This commit is contained in:
@@ -25,10 +25,9 @@ class GeneralManagerController extends Controller
|
|||||||
use ApiResponse;
|
use ApiResponse;
|
||||||
public function index(Request $request): JsonResponse
|
public function index(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
$user = auth()->user();
|
|
||||||
$query = Harim::query()
|
$query = Harim::query()
|
||||||
->where('state_id', '=', HarimStates::BARESI_TAVASOT_MODIR_KOL->value)
|
->whereIn('state_id', [HarimStates::BARESI_TAVASOT_MODIR_KOL->value, HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_MODIR_KOL->value])
|
||||||
->where('edareh_shahri_id', '=', $user->edarate_shahri_id);
|
->where('edareh_shahri_id', '=', auth()->user()->edarate_shahri_id);
|
||||||
|
|
||||||
$data = DataTableFacade::run(
|
$data = DataTableFacade::run(
|
||||||
$query,
|
$query,
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ class ShowRequest extends FormRequest
|
|||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
return $this->harim->edareh_shahri_id == auth()->user()->edarate_shahri_id &&
|
||||||
$this->harim->state_id == HarimStates::Baresi_Imeni_Rah_Tavasot_Modir_Kol->value;
|
in_array($this->harim->state_id, [
|
||||||
|
HarimStates::BARESI_TAVASOT_MODIR_KOL->value,
|
||||||
|
HarimStates::BARESI_FILE_APLODE_SHODE_TAVASOTE_MODIR_KOL->value
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user