本文整理汇总了PHP中Skill::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::where方法的具体用法?PHP Skill::where怎么用?PHP Skill::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::where方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
if (!Auth::check()) {
return Redirect::guest('/ow_login');
}
$resume = Auth::user()->resume()->first();
if (is_null($resume)) {
Flash::success("请先完善资料,在查看资料");
return Redirect::route('editsetting')->with('message', "请先完善资料,在查看资料");
}
$projects = Auth::user()->projects()->first();
$skill = Skill::where('id', '=', $resume->skill_id)->first()->skill;
return View::make('account.index', compact('resume', 'projects', 'skill'));
// if(!Auth::check()){
// return Redirect::intended('/');
// }
//
// return View::make('account.index');
}
示例2: show
public function show($id)
{
$resume = Resume::where('user_id', '=', $id)->first();
$user = User::findOrFail($id);
$from = $user->fanssystem_from()->count();
$to = $user->fanssystem_to()->count();
$bFocus = Fanssystem::isFocus($id);
$fans = array();
$fans[0] = $from;
$fans[1] = $to;
$fans[2] = $bFocus;
$topics = Topic::whose($user->id)->recent()->paginate(6);
$favoritetopics = $user->favoriteTopics()->paginate(6);
$replies = Reply::whose($user->id)->recent()->limit(6)->get();
if (is_null($resume)) {
return View::make('usersinfo.show', compact('user', 'topics', 'replies', 'favoritetopics', 'fans'));
}
$skill = Skill::where('id', '=', $resume->skill_id)->first()->skill;
if (!is_null($resume)) {
$projects = $resume->userproject()->get();
return View::make('usersinfo.show', compact('user', 'topics', 'replies', 'resume', 'projects', 'favoritetopics', 'skill', 'fans'));
}
return View::make('usersinfo.show', compact('user', 'topics', 'replies', 'resume', 'favoritetopics', 'fans'));
}