本文整理汇总了PHP中Software::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Software::orderBy方法的具体用法?PHP Software::orderBy怎么用?PHP Software::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Software
的用法示例。
在下文中一共展示了Software::orderBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: advancedSearch
public function advancedSearch()
{
if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin" || Session::get("user_type") == "User")) {
$view = View::make("Assets.Software.software_advanced_search");
$view->nav = "assets";
$view->tab = "search";
$view->software = Software::orderBy("asset_tag")->paginate(25);
$view->results = Software::all()->count();
$getSoftwareTypes = SoftwareType::all();
$softwareTypes = array("" => "--Select One--");
foreach ($getSoftwareTypes as $gst) {
$softwareTypes[$gst->id] = $gst->software_type;
}
$view->softwareTypes = $softwareTypes;
return $view;
} else {
return Redirect::to("/");
}
}
示例2: exportSoftware
public function exportSoftware()
{
if (Session::has('username') && (Session::get('user_type') == "Root" || Session::get('user_type') == "Admin")) {
$view = View::make("Export.export_software");
$view->nav = "system";
$view->tab = "software";
$view->software = Software::orderBy("asset_tag")->paginate(25);
$view->results = Software::all()->count();
$getSoftwareTypes = SoftwareType::all();
$softwareTypes = array("" => "--Select One--");
foreach ($getSoftwareTypes as $gst) {
$softwareTypes[$gst->id] = $gst->software_type;
}
$view->softwareTypes = $softwareTypes;
return $view;
} else {
return Redirect::to("/");
}
}