本文整理匯總了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'));
}