Browse Source

Merge branch 'staging' of https://git.oslog.id/OSPRO/ADW-Backend into staging

pull/3/head
Ibnu Hamdani 2 years ago
parent
commit
076071d379
  1. 38
      Dockerfile
  2. 11
      app/Http/Controllers/ProjectController.php
  3. 4
      docker-compose.yml

38
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

11
app/Http/Controllers/ProjectController.php

@ -251,12 +251,18 @@ 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');
$projectTypes = ProjectType::orderBy('id', 'asc')->pluck('name');
try {
@ -288,6 +294,7 @@ class ProjectController extends Controller
'totalActualCost' => $totalActualCost,
'totalRevenue' => $totalPlannedCost - $totalActualCost,
'manpowers' => $manpowers,
'projectsOnDanger'=> $projectsOnDanger,
'projectPhases' => $projectPhases,
'projectsByPhase' => $projectsByPhase,
'projectTypes' => $projectTypes,

4
docker-compose.yml

@ -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:
- '5435:5432'
networks:

Loading…
Cancel
Save