From 8b3bece9c08b8d24e205c5d03640a3f3bd0d479a Mon Sep 17 00:00:00 2001 From: wahyuun Date: Thu, 21 Dec 2023 11:53:50 +0700 Subject: [PATCH 1/3] add scoupe of work & fillable --- app/Http/Controllers/UserToProyekController.php | 3 ++- app/Models/Project.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/UserToProyekController.php b/app/Http/Controllers/UserToProyekController.php index f6fca59..a0606ea 100644 --- a/app/Http/Controllers/UserToProyekController.php +++ b/app/Http/Controllers/UserToProyekController.php @@ -50,7 +50,8 @@ class UserToProyekController extends Controller "user_id" => $item, "proyek_id" => $request->proyek_id, "created_by" => $this->currentName, - 'is_customer'=>true + 'is_customer'=>true, + 'project_role'=> $request->project_role ); $result = UserToProyek::create($dataInsert); diff --git a/app/Models/Project.php b/app/Models/Project.php index 2226419..1e575d6 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -23,6 +23,7 @@ class Project extends Model 'biaya_actual', 'company', 'pm_id', + 'scoupe_of_work', 'type_proyek_id', 'divisi_id', 'value_proyek', From d023856cb3980040efc2239eae057e4946d15ee4 Mon Sep 17 00:00:00 2001 From: ibnu Date: Thu, 21 Dec 2023 16:37:45 +0700 Subject: [PATCH 2/3] update where proyek_id --- app/Http/Controllers/UserToActivityController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/UserToActivityController.php b/app/Http/Controllers/UserToActivityController.php index 9703946..5a2238d 100644 --- a/app/Http/Controllers/UserToActivityController.php +++ b/app/Http/Controllers/UserToActivityController.php @@ -202,6 +202,7 @@ class UserToActivityController extends Controller ->where('ahta.user_id', $payload['user_id']) ->where('ma.start_date', '<=', $payload['start_date']) ->where('ma.end_date', '>=', $payload['end_date']) + ->where('ma.proyek', '>=', $payload['proyek_id']) ->get(); if ($payload['status'] != "") { From 8110897a3b1338de914ab14acd0ba32b59d23e40 Mon Sep 17 00:00:00 2001 From: ibnu Date: Thu, 21 Dec 2023 17:06:49 +0700 Subject: [PATCH 3/3] update add divisi name --- app/Http/Controllers/DashboardBoDController.php | 5 +++-- app/Models/Project.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/DashboardBoDController.php b/app/Http/Controllers/DashboardBoDController.php index af68816..70bb309 100644 --- a/app/Http/Controllers/DashboardBoDController.php +++ b/app/Http/Controllers/DashboardBoDController.php @@ -350,8 +350,9 @@ class DashboardBoDController extends Controller public function getDetailExpenditure($year = '%') { $year = $this->interpolateYear($year); - $projects = Project::where('mulai_proyek', 'like', $year) - /* ->orWhere('akhir_proyek', 'like', $year) */ + $projects = Project::select('m_proyek.*', 'md.name as divisi_name') + ->where('mulai_proyek', 'like', $year) + ->join('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id') ->orderBy('id', 'desc') ->get(); foreach ($projects as $project) { diff --git a/app/Models/Project.php b/app/Models/Project.php index 1e575d6..2721944 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -15,6 +15,7 @@ class Project extends Model 'kode_sortname', 'jumlah_stakeholder', 'nama', + 'nickname', 'mulai_proyek', 'akhir_proyek', 'area_kerja',