本文整理汇总了PHP中Owner::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Owner::orderBy方法的具体用法?PHP Owner::orderBy怎么用?PHP Owner::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Owner
的用法示例。
在下文中一共展示了Owner::orderBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sortur
public function sortur()
{
$valu = $_GET['valu'];
$type = $_GET['type'];
Session::put('valu', $valu);
Session::put('type', $type);
if ($type == 'userid') {
$typename = "Owner ID";
$users = Owner::orderBy('id', $valu)->paginate(10);
} elseif ($type == 'username') {
$typename = "Owner Name";
$users = Owner::orderBy('first_name', $valu)->paginate(10);
} elseif ($type == 'useremail') {
$typename = "Owner Email";
$users = Owner::orderBy('email', $valu)->paginate(10);
}
$title = ucwords(trans('customize.User') . 's' . " | Sorted by " . $typename . " in " . $valu);
/* 'Owners | Sorted by ' . $typename . ' in ' . $valu */
return View::make('owners')->with('title', $title)->with('page', 'owners')->with('owners', $users);
}
示例2: sortur
public function sortur()
{
$valu = $_GET['valu'];
$type = $_GET['type'];
Session::put('valu', $valu);
Session::put('type', $type);
if ($type == 'userid') {
$typename = "User ID";
$users = Owner::orderBy('id', $valu)->paginate(10);
} elseif ($type == 'username') {
$typename = "User Name";
$users = Owner::orderBy('first_name', $valu)->paginate(10);
} elseif ($type == 'useremail') {
$typename = "User Email";
$users = Owner::orderBy('email', $valu)->paginate(10);
}
return View::make('owners')->with('title', 'Owners | Sorted by ' . $typename . ' in ' . $valu)->with('page', 'owners')->with('owners', $users);
}