当前位置: 首页>>代码示例>>PHP>>正文


PHP Employee::orderBy方法代码示例

本文整理汇总了PHP中Employee::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::orderBy方法的具体用法?PHP Employee::orderBy怎么用?PHP Employee::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Employee的用法示例。


在下文中一共展示了Employee::orderBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getViewAllEmployee

 /**
  *  This function responses to
  *  the get request of /admin/employee
  *  and shows all employee as list
  */
 public function getViewAllEmployee($msg = null)
 {
     if (!empty($msg) && $msg == 1) {
         return View::make('adminArea.employee.view')->with('employees', Employee::orderBy('id', 'desc')->get())->with('success', 'Employee has been deleted successfully');
     }
     return View::make('adminArea.employee.view')->with('employees', Employee::orderBy('id', 'desc')->get());
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:12,代码来源:EmployeeController.php

示例2: manageEmployees

 /**
  * Show employee management tabs
  *
  * @return mixed
  */
 public function manageEmployees()
 {
     $dept = ['' => 'Choose...'] + Department::lists('name', 'id');
     $location = ['' => 'Choose...'] + Location::lists('name', 'id');
     foreach (Employee::orderBy('lastname', 'ASC')->get() as $emp) {
         $fullNames[] = $emp->firstname . ' ' . $emp->lastname;
         $empIds[] = $emp->id;
     }
     $employees = array_combine($empIds, $fullNames);
     $employees = ['' => 'Choose...'] + $employees;
     return View::make('admin.employees', compact('dept', 'location', 'employees'));
 }
开发者ID:heidilux,项目名称:Company-Directory-L4,代码行数:17,代码来源:AdminController.php

示例3: getEmployeesObjectList

 public static function getEmployeesObjectList()
 {
     $employeesList = Employee::orderBy('name', 'asc')->get();
     return $employeesList;
 }
开发者ID:dbakiu,项目名称:dvc,代码行数:5,代码来源:Employee.php

示例4: 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("Employees.advanced_search_employees");
         $view->employees = Employee::orderBy("last_name", "asc")->paginate(25);
         $view->nav = "employees";
         $getManagers = Manager::orderBy('last_name', 'asc')->get();
         $managers = array("all" => "All", "" => "None");
         foreach ($getManagers as $manager) {
             if (!empty($manager["first_name"])) {
                 $managers[$manager["id"]] = $manager["last_name"] . ", " . $manager["first_name"];
             } else {
                 $managers[$manager["id"]] = $manager["last_name"];
             }
         }
         $view->managers = $managers;
         $view->result = Employee::all()->count();
         return $view;
     } else {
         return Redirect::to('/');
     }
 }
开发者ID:johndavedecena,项目名称:vault,代码行数:22,代码来源:EmployeeController.php


注:本文中的Employee::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。