Browse Source

Merge pull request 'update report analysis' (#243) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#243
pull/3/head
farhantock 1 year ago
parent
commit
fb9d38c454
  1. 6
      app/Http/Controllers/ActivityController.php

6
app/Http/Controllers/ActivityController.php

@ -544,8 +544,8 @@ class ActivityController extends Controller
{
$dataBuilder = $this->setUpPayload($request->all(), 'm_activity');
$builder = $dataBuilder['builder'];
$dataGet = $builder->select( 'selfTable.name', 'persentase_progress', 'selfTable.start_date', 'selfTable.end_date', 'duration', 'assign_hr_to_activity.id',
'm_version_gantt.name_version', 'm_users.name as user_name',
$dataGet = $builder->select( 'selfTable.name', 'persentase_progress', 'selfTable.start_date', 'selfTable.end_date', 'duration',
'm_version_gantt.name_version', DB::raw('STRING_AGG(m_users.name, \',\') as user_name'),
DB::raw('SUM(report_activity_material.qty) as qty'), 'assign_material_to_activity.qty_planning',
'assign_material_to_activity.id as join_third_id')
->join('m_version_gantt', 'm_version_gantt.id', '=', 'selfTable.version_gantt_id')
@ -557,10 +557,8 @@ class ActivityController extends Controller
->groupBy("selfTable.name")
->groupBy("selfTable.persentase_progress")
->groupBy("m_version_gantt.name_version")
->groupBy("m_users.name")
->groupBy("assign_material_to_activity.qty_planning")
->groupBy("assign_material_to_activity.id")
->groupBy("assign_hr_to_activity.id")
->get();
return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet ], 200);
}

Loading…
Cancel
Save