Browse Source

update Logic Presence

pull/3/head
wahyuun 1 year ago
parent
commit
af307f413b
  1. 20
      app/Http/Controllers/PresenceController.php

20
app/Http/Controllers/PresenceController.php

@ -135,13 +135,23 @@ class PresenceController extends Controller
$checkLocation = $this->checkLocation($request); $checkLocation = $this->checkLocation($request);
$statusBoundary = false; $statusBoundary = false;
$date = date_create($request->time); $date = date_create($request->time);
$statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first();
// assign and in boundary // assign and in boundary
if(count($checkLocation) > 0 && $checkLocation[0]['boundary']){ if (count($checkLocation) > 0 && $statusRestriction->status_boundary == true)
$statusBoundary = true; {
if ($checkLocation[0]['boundary'] == true)
{
$statusBoundary = true;
} else {
$statusBoundary = false;
}
} }
$statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first(); // assign and not in boundary or in boundary
if (!$statusRestriction->status_boundary) { else {
$statusBoundary = true; if ($checkLocation[0]['boundary'] == true || $checkLocation[0]['boundary'] == false)
{
$statusBoundary = true;
}
} }
// not assign // not assign
if(!$checkLocation[0]['status_assign'] && $checkLocation[0]['boundary'] == false && $statusBoundary == false){ if(!$checkLocation[0]['status_assign'] && $checkLocation[0]['boundary'] == false && $statusBoundary == false){

Loading…
Cancel
Save