From 2ac211ffafef1cc97ede96a36891b091b4c61ca4 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Tue, 15 Aug 2023 15:05:44 +0700 Subject: [PATCH 1/2] Fix multiarea geom --- app/Http/Controllers/PresenceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PresenceController.php b/app/Http/Controllers/PresenceController.php index 00980cc..018052e 100644 --- a/app/Http/Controllers/PresenceController.php +++ b/app/Http/Controllers/PresenceController.php @@ -267,7 +267,7 @@ class PresenceController extends Controller // return count($valGeom->features); $multiArea = $valGeom->features; foreach($multiArea as $area){ - $check = DB::select(DB::raw("SELECT ST_Intersects(ST_GeomFromGeoJSON('".json_encode($valGeom->geometry)."'), + $check = DB::select(DB::raw("SELECT ST_Intersects(ST_GeomFromGeoJSON('".json_encode($area->geometry)."'), ST_GeomFromText('POINT(".$params->clock_in_out['clock_out_lng']." ".$params->clock_in_out['clock_out_lat'].")', 4326)) as boundary")); if($check[0]->boundary){ break; From a0cff6bf7083e40e86e65635b587b73497bd43d4 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Tue, 15 Aug 2023 16:00:12 +0700 Subject: [PATCH 2/2] Fix project list map monitoring --- app/Http/Controllers/ProjectController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 1787d88..e2d25ce 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -278,7 +278,7 @@ class ProjectController extends Controller } try { $projectsByType = DB::table('m_proyek') - ->select('m_type_proyek.name', DB::raw('count(id) as total')) + ->select('m_type_proyek.name', DB::raw('count(m_type_proyek.id) as total')) ->join('m_type_proyek', 'm_type_proyek.id', '=', 'm_proyek.type_proyek_id') ->groupBy('m_type_proyek.name') ->get();