|
|
@ -26,6 +26,7 @@ class UserToActivityController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
public function addMultiple(Request $request){ |
|
|
|
public function addMultiple(Request $request){ |
|
|
|
$users_id = $request->user_id; |
|
|
|
$users_id = $request->user_id; |
|
|
|
|
|
|
|
$users_role = $request->role_proyek_id; |
|
|
|
|
|
|
|
|
|
|
|
// $data = UserToActivity::where("activity_id", $request->activity_id); |
|
|
|
// $data = UserToActivity::where("activity_id", $request->activity_id); |
|
|
|
// if($data){ |
|
|
|
// if($data){ |
|
|
@ -34,11 +35,11 @@ class UserToActivityController extends Controller |
|
|
|
|
|
|
|
|
|
|
|
if(is_array($users_id) && count($users_id) > 0){ |
|
|
|
if(is_array($users_id) && count($users_id) > 0){ |
|
|
|
$countRes = 0; |
|
|
|
$countRes = 0; |
|
|
|
foreach($users_id as $item){ |
|
|
|
foreach($users_id as $index => $item){ |
|
|
|
$dataInsert = array( |
|
|
|
$dataInsert = array( |
|
|
|
"user_id" => $item, |
|
|
|
"user_id" => $item, |
|
|
|
"activity_id" => $request->activity_id, |
|
|
|
"activity_id" => $request->activity_id, |
|
|
|
"role_proyek_id" => $request->role_proyek_id, |
|
|
|
"role_proyek_id" => $users_role[$index], |
|
|
|
"proyek_id" => $request->proyek_id, |
|
|
|
"proyek_id" => $request->proyek_id, |
|
|
|
"created_by" => $this->currentName |
|
|
|
"created_by" => $this->currentName |
|
|
|
); |
|
|
|
); |
|
|
|