From 199d34fdd4a31386f10e7f598e862e3302a34f74 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 23 Aug 2023 14:50:26 +0700 Subject: [PATCH] Fix work area restriction --- app/Http/Controllers/PresenceController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PresenceController.php b/app/Http/Controllers/PresenceController.php index 6c40779..ad0501c 100644 --- a/app/Http/Controllers/PresenceController.php +++ b/app/Http/Controllers/PresenceController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers; +use App\Models\HumanResource; use Log; use Illuminate\Http\Request; use App\Models\Presence; @@ -24,7 +25,10 @@ class PresenceController extends Controller if(count($checkLocation) > 0 && $checkLocation[0]['boundary']){ $statusBoundary = true; } - + $statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first(); + if ($statusRestriction->status_boundary) { + $statusBoundary = true; + } // not assign if(!$checkLocation[0]['status_assign'] && $checkLocation[0]['boundary'] == false){ $data=array( @@ -134,7 +138,10 @@ class PresenceController extends Controller if(count($checkLocation) > 0 && $checkLocation[0]['boundary']){ $statusBoundary = true; } - + $statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first(); + if ($statusRestriction->status_boundary) { + $statusBoundary = true; + } // not assign if(!$checkLocation[0]['status_assign'] && $checkLocation[0]['boundary'] == false){ $data=array(