Browse Source

Merge pull request 'staging upload 23-05-23' (#63) from staging into master

Reviewed-on: ordo/adw-backend#63
pull/3/head
ibnu 2 years ago
parent
commit
04de22e115
  1. 20
      app/Http/Controllers/ActivityController.php

20
app/Http/Controllers/ActivityController.php

@ -9,6 +9,8 @@ use App\Models\TemplateGantt;
use App\Models\TmpImport;
use App\Models\VersionGantt;
use App\Models\UserToActivity;
use App\Models\UserToProyek;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
@ -462,7 +464,23 @@ class ActivityController extends Controller
$activity->type_activity = "project";
$activity->save();
$activity->level = $activity_row['level'];
}
}
if (isset($data['activities'][$i]['nik'])) {
$user = User::where("ktp_number", $data['activities'][$i]['nik'])->first();
$userProyek = UserToProyek::where("user_id", $user->id)
->where("proyek_id", $projectId)
->first();
$dataInsert = array(
"user_id" => $user->id,
"activity_id" => $activity->id,
"role_proyek_id" => $userProyek->project_role,
"proyek_id" => $projectId,
"created_by" => $this->currentName,
"version_gantt_id" => $data['ganttId']
);
UserToActivity::create($dataInsert);
}
if (!empty($activity_row['predecessor'])) {
$key = array_search($activity_row['predecessor'], array_column($data['activities'], 'no'));

Loading…
Cancel
Save