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


PHP Employee::orderBy方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $suppliers = Supplier::orderBy('name')->get();
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:12,代码来源:InventoryController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id = null)
 {
     if ($id == null) {
         return Employee::orderBy('id', 'asc')->get();
     } else {
         return $this->show($id);
     }
 }
开发者ID:buddhashilpa,项目名称:learningapp,代码行数:13,代码来源:Employees.php

示例3: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     $view->with('select_failure_mode', ['Assembly', 'Environment', 'Machine', 'Man', 'Material', 'Method / Process']);
     $view->with('customers', Option::orderBy('customer')->select('customer')->get());
     $view->with('machines', Machine::orderBy('name')->select('name')->get());
     $view->with('stations', Station::select('station')->get());
     $view->with('employees', Employee::orderBy('name')->select('name')->where('name', '<>', Auth::user()->employee->name)->get());
 }
开发者ID:rob1121,项目名称:qdn,代码行数:14,代码来源:FormOptionComposer.php

示例4: index

 public function index($id = null)
 {
     if ($id == null) {
         return Employee::orderBy('id', 'ASC')->get();
     } else {
         return Employee::findOrFail($id);
     }
 }
开发者ID:hoangnh228,项目名称:angularavel,代码行数:8,代码来源:EmployeeController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $employees = Employee::orderBy('id', 'desc')->get();
     foreach ($employees as $key => $value) {
         $posname = Position::find($value->position_id);
         $employees[$key]->position_name = $posname ? $posname->name : "";
     }
     $positions = Position::all();
     $nationalities = Nationality::all();
     return view('employee.listemployee', compact('employees', 'positions', 'nationalities'));
 }
开发者ID:phanngoc,项目名称:internal-tool,代码行数:16,代码来源:EmployeeController.php

示例6: create

 public function create()
 {
     $input = Input::all();
     $customer = null;
     if ($input != null) {
         $customer = Customer::firstOrNew(['name' => $input['order_by']]);
         $customer->address = $input['address'];
         $customer->save();
     }
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('order.create', compact(['employees', 'input', 'customer', 'customers']));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:13,代码来源:OrderController.php

示例7: create

 public function create()
 {
     $salesmen = Employee::orderBy('firstname')->get();
     $input = Input::all();
     return view('badorder.create', compact('salesmen', 'input'));
 }
开发者ID:MangTomas23,项目名称:tgm,代码行数:6,代码来源:BadOrderController.php

示例8: getEmployeesForDropdownList

 /**
  * Grab an array of employees with id => name
  * in order to populate a select dropdown
  *
  * @return array
  * @internal param $fullNames
  * @internal param $empIds
  */
 private function getEmployeesForDropdownList()
 {
     foreach (Employee::orderBy('lastname', 'ASC')->get() as $emp) {
         $fullNames[] = $emp->firstname . ' ' . $emp->lastname;
         $empIds[] = $emp->id;
     }
     $employees = array_combine($empIds, $fullNames);
     return $employees;
 }
开发者ID:heidilux,项目名称:Laravel-Company-Directory,代码行数:17,代码来源:EmployeeController.php


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