From ea1c64bf1abe09cc4965b69f1987deed88f83e9b Mon Sep 17 00:00:00 2001 From: Yusuf Date: Fri, 5 Aug 2022 16:17:20 +0700 Subject: [PATCH 1/3] projects on danger --- app/Http/Controllers/ProjectController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 578ce35..bb9d679 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -257,6 +257,7 @@ class ProjectController extends Controller $totalActualCost = $data->sum('actualCost'); // $manpowers = User::where('employee_type', 'employee')->count(); $manpowers = User::count(); + $projectsOnDanger = Project::where('budget_health', 'danger')->count(); $projectPhases = ProjectPhase::orderBy('order', 'asc')->pluck('name'); $projectTypes = ProjectType::orderBy('id', 'asc')->pluck('name'); try { @@ -288,6 +289,7 @@ class ProjectController extends Controller 'totalActualCost' => $totalActualCost, 'totalRevenue' => $totalPlannedCost - $totalActualCost, 'manpowers' => $manpowers, + 'projectsOnDanger'=> $projectsOnDanger, 'projectPhases' => $projectPhases, 'projectsByPhase' => $projectsByPhase, 'projectTypes' => $projectTypes, From 0cb1fe0b437b7f842a81b3a18271de100e179a0f Mon Sep 17 00:00:00 2001 From: Yusuf Date: Fri, 5 Aug 2022 23:35:20 +0700 Subject: [PATCH 2/3] revise --- app/Http/Controllers/ProjectController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index bb9d679..507cb74 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -251,11 +251,16 @@ class ProjectController extends Controller $d->scheduleHealth = $scheduleHealth; $d->progress = $progress; $d->lastGanttId = VersionGantt::where("proyek_id", $d->id)->orderBy('id', 'desc')->first()->id ?? null; - } + $d->manpower = UserToProyek::where("proyek_id", $d->id)->count() ?? 0; + $d->projectManager = DB::table('m_proyek') + ->join('m_users', 'm_users.id', '=', 'm_proyek.pm_id') + ->where('m_proyek.id', $d->id) + ->pluck('m_users.name') + ->first(); + } $totalPlannedCost = $data->sum('plannedCost'); $totalActualCost = $data->sum('actualCost'); - // $manpowers = User::where('employee_type', 'employee')->count(); $manpowers = User::count(); $projectsOnDanger = Project::where('budget_health', 'danger')->count(); $projectPhases = ProjectPhase::orderBy('order', 'asc')->pluck('name'); From b9479dcb37ffdcc953545650e1792f8c73e4c411 Mon Sep 17 00:00:00 2001 From: Yusuf Date: Sat, 6 Aug 2022 03:44:53 +0700 Subject: [PATCH 3/3] fix db conn --- Dockerfile | 42 +++++++++++++++++++++++++++--------------- docker-compose.yml | 6 +++--- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 15e997f..4edd5c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,37 @@ FROM php:7.4-fpm-alpine RUN apk add --update libzip-dev curl-dev &&\ - apk del gcc g++ + apk del gcc g++ RUN apk add --no-cache \ - zlib-dev \ - icu-dev \ - libpng-dev \ - oniguruma-dev \ - libpq-dev + zlib-dev \ + icu-dev \ + libpng-dev \ + oniguruma-dev \ + libpq-dev \ + libpng-dev \ + libzip-dev \ + zip \ + vim \ + unzip \ + git \ + curl + RUN rm -rf /var/cache/apk/* RUN docker-php-ext-install \ - curl \ - mbstring \ - intl \ - pdo \ - pdo_pgsql \ - pgsql \ - tokenizer + curl \ + mbstring \ + intl \ + pdo \ + pdo_pgsql \ + pgsql \ + tokenizer + +#Install Extensions +RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql + RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer @@ -28,8 +40,8 @@ WORKDIR /var/www/html COPY . . RUN chmod +x artisan -#RUN composer install --ignore-platform-reqs --prefer-dist --no-scripts --no-progress --no-interaction --no-dev --no-autoloader -#RUN composer dump-autoload --optimize +RUN composer install --ignore-platform-reqs --prefer-dist --no-scripts --no-progress --no-interaction --no-dev --no-autoloader +RUN composer dump-autoload --optimize RUN chown -R www-data:www-data . diff --git a/docker-compose.yml b/docker-compose.yml index ce2c29f..8cb9402 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - '80:80' - '443:443' volumes: - - .:/var/www/html:ro,cached + - .:/var/www/html - ./docker/nginx/conf.d/:/etc/nginx/conf.d/ links: - app @@ -27,8 +27,8 @@ services: image: postgres:14.4-alpine restart: always environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres + - POSTGRES_USER=posgres + - POSTGRES_PASSWORD=posgres ports: - '5432:5432' networks: