public function update_skill(Request $request) { // return $request->all(); $user_id = $this->user->id; User_skill::where("user_id", $user_id)->delete(); //删除原始数据 //技能表 foreach ($request->except(['s_other']) as $skill => $value) { $user_skill = []; $user_skill['user_id'] = $user_id; $user_skill['skill_id'] = $skill; $user_skill['value'] = $value; User_skill::create($user_skill); } //补充技能 User::where('id', $user_id)->update(['s_other' => $request->s_other]); return redirect('/my/edit/edit_resume'); }
function skill_store(Request $request) { $user_id = $this->user->id; User_skill::where("user_id", $user_id)->delete(); //删除原始数据 //技能表 foreach ($request->except(['s_other']) as $skill => $value) { $user_skill = []; $user_skill['user_id'] = $user_id; $user_skill['skill_id'] = $skill; $user_skill['value'] = $value; User_skill::create($user_skill); } //补充技能 User::where('id', $user_id)->update(['s_other' => $request->s_other]); //更新session $this->refresh_session_user(); return redirect('/my/regist/rireki'); }