Browse Source

Merge pull request 'dev-wahyu' (#184) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#184
pull/3/head
ibnu 1 year ago
parent
commit
58a8728a09
  1. 7
      app/Http/Controllers/PresenceController.php

7
app/Http/Controllers/PresenceController.php

@ -258,6 +258,7 @@ class PresenceController extends Controller
// cek user tersebut apakah punya assign task yang ada bondary nya
// geom ada di table activity
// $clock_time =
$user = HumanResource::find($params->user_id);
$geom = DB::table("assign_hr_to_activity as ahta")->select("ma.geom", "ma.id")
->join("m_activity as ma", "ma.id", "=", "ahta.activity_id")
->where("ahta.user_id", $params->user_id)
@ -326,14 +327,14 @@ class PresenceController extends Controller
ST_GeomFromText('POINT(".$params->clock_in_out['clock_in_lng']." ".$params->clock_in_out['clock_in_lat'].")', 4326)) as boundary"));
}
}
if(count($check)>0){
if(isset($check[0]->boundary) && $check[0]->boundary){
if(!$user->status_boundary || count($check)>0){
if(!$user->status_boundary || (isset($check[0]->boundary) && $check[0]->boundary)){
$temp[]=array(
"activity_id" => $dataGeom->id,
"boundary" => $check[0]->boundary,
"status_assign" => true
);
} else if (isset($check[0]->within_radius) && $check[0]->within_radius) {
} else if (!$user->status_boundary || (isset($check[0]->within_radius) && $check[0]->within_radius)) {
$temp[]=array(
"activity_id" => $dataGeom->id,
"boundary" => $check[0]->within_radius,

Loading…
Cancel
Save