|
|
|
@ -439,10 +439,26 @@ class ProjectController extends Controller
|
|
|
|
|
|
|
|
|
|
$response = MasterFunctionsHelper::curlReq($url); |
|
|
|
|
|
|
|
|
|
// return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); |
|
|
|
|
return response()->json(['status'=>'success', 'data'=> '', 'code'=>200], 200); |
|
|
|
|
return response()->json(['status'=>'success', 'data'=> $response, 'code'=>200], 200); |
|
|
|
|
} |
|
|
|
|
public function getByUser($id) |
|
|
|
|
{ |
|
|
|
|
$alias = "utp"; |
|
|
|
|
$userProyek = UserToProyek::query() |
|
|
|
|
->from('assign_hr_to_proyek AS ' . $alias) |
|
|
|
|
->where([ |
|
|
|
|
['is_customer', true], |
|
|
|
|
['user_id', $id] |
|
|
|
|
]) |
|
|
|
|
->leftJoin('m_users', $alias.'.user_id', '=', 'm_users.id') |
|
|
|
|
->leftJoin('m_proyek', $alias.'.proyek_id', '=', 'm_proyek.id') |
|
|
|
|
->leftJoin('m_type_proyek', 'm_proyek.type_proyek_id', '=', 'm_type_proyek.id') |
|
|
|
|
->select('m_proyek.*', 'm_type_proyek.name AS join_second_name','m_users.name AS join_first_name') |
|
|
|
|
->get(); |
|
|
|
|
$totalRecord = $userProyek->count(); |
|
|
|
|
|
|
|
|
|
return response()->json(['status' => 'success', 'code' => 200, 'data' => $userProyek, 'totalRecord' => $totalRecord], 200); |
|
|
|
|
} |
|
|
|
|
public function detail($id){ |
|
|
|
|
if(empty($id) || !is_int((int)$id)) |
|
|
|
|
return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); |
|
|
|
|