本文整理汇总了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']));
}
示例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);
}
}
示例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());
}
示例4: index
public function index($id = null)
{
if ($id == null) {
return Employee::orderBy('id', 'ASC')->get();
} else {
return Employee::findOrFail($id);
}
}
示例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'));
}
示例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']));
}
示例7: create
public function create()
{
$salesmen = Employee::orderBy('firstname')->get();
$input = Input::all();
return view('badorder.create', compact('salesmen', 'input'));
}
示例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;
}