Ejemplo n.º 1
0
 function edit_skill()
 {
     $skill_categories = Skill_category::with('skills')->orderBy('sort_order', 'asc')->get();
     //        return $skill_categories;
     $user_skills = User_skill::where('user_id', $this->user['id'])->get();
     $my_skills = [];
     foreach ($user_skills as $skill) {
         $my_skills["{$skill->skill_id}"] = $skill->value;
     }
     //        return ($user_skills);
     //        return ($my_skills);
     return view('my.edit.skill', ['skill_categories' => $skill_categories, 'user_skills' => $user_skills, 'my_skills' => $my_skills]);
 }
Ejemplo n.º 2
0
 function skill()
 {
     //技能列表
     $skill_categories = Skill_category::with('skills')->orderBy('sort_order')->get();
     //        return $skill_categories;
     //当前用户的技能,并重新组装数组
     $user_skills = User_skill::where('user_id', $this->user->id)->get();
     $my_skills = [];
     foreach ($user_skills as $skill) {
         $my_skills["{$skill->skill_id}"] = $skill->value;
     }
     //        return $my_skills;
     return view('my.regist.skill')->with('skill_categories', $skill_categories)->with('my_skills', $my_skills);
 }