Browse Source

update progress import

pull/3/head
ibnu 2 years ago
parent
commit
0789ad8924
  1. 10
      app/Http/Controllers/ActivityController.php

10
app/Http/Controllers/ActivityController.php

@ -393,12 +393,12 @@ class ActivityController extends Controller
{ {
$data = $request->all(); $data = $request->all();
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;
Activity::where('version_gantt_id', $data['ganttId'])->delete(); Activity::where('version_gantt_id', $data['gantt_id'])->delete();
$projectId = VersionGantt::where('id', $data['ganttId'])->first()->proyek_id; $projectId = VersionGantt::where('id', $data['gantt_id'])->first()->proyek_id;
// get data excel // get data excel
$excel = TmpImport::lates('id')->first(); $excel = TmpImport::latest('id')->first();
return response()->json(['stack' => $excel, 'status' => 'success', 'message' => 'Data imported!', 'projectId' => $projectId, 'code' => 200], 200); return response()->json(['stack' => $excel, 'status' => 'success', 'message' => 'Data imported!', 'data' => $data, 'code' => 200], 200);
} }
public function uploadTmpImport(Request $request) public function uploadTmpImport(Request $request)
@ -411,7 +411,7 @@ class ActivityController extends Controller
$result = $document->move($this->pathTmpImport, $name); $result = $document->move($this->pathTmpImport, $name);
if($result){ if($result){
$data = [ $data = [
'ref_id' => (int)$gantt_id, 'gantt_id' => (int)$gantt_id,
'file' => $name, 'file' => $name,
'type_dokumen' => $request->type_dokumen 'type_dokumen' => $request->type_dokumen
]; ];

Loading…
Cancel
Save