本文整理汇总了PHP中app\models\Group::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::orderBy方法的具体用法?PHP Group::orderBy怎么用?PHP Group::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Group
的用法示例。
在下文中一共展示了Group::orderBy方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$data['groups'] = Group::orderBy('groupname')->get();
$data['setting'] = Setting::find($id);
$data['themes'] = array('cerulean' => 'cerulean', 'cosmo' => 'cosmo', 'cyborg' => 'cyborg', 'darkly' => 'darkly', 'flatly' => 'flatly', 'journal' => 'journal', 'lumen' => 'lumen', 'paper' => 'paper', 'readable' => 'readable', 'sandstone' => 'sandstone', 'simplex' => 'simplex', 'slate' => 'slate', 'spacelab' => 'spacelab', 'superhero' => 'superhero', 'united' => 'united', 'yeti' => 'yeti');
return View::make('settings.edit', $data);
}
示例2: index
public function index()
{
$groups = Group::orderBy('position')->get();
$group = new Group();
if (Request::isMethod('post')) {
$validator = Validator::make(Request::all(), $this->rules, $this->messages);
if ($validator->passes()) {
$group->title = Request::input('title');
$group->titleEng = Request::input('titleEng');
$group->text = Request::input('text');
$group->eng = Request::input('eng');
$group->link = Request::input('link');
$group->position = Request::input('position');
$group->enabled = Request::has('enabled');
if ($file = Request::file('photo')) {
$group->photo = $this->upload($file, 'photo');
}
if ($file = Request::file('partners')) {
$group->partners = $this->upload($file, 'photo');
}
$group->save();
return redirect('admin/group')->with('msg', 'Агентство было успешно создано');
} else {
return redirect('admin/group')->withInput()->withErrors($validator);
}
}
return view('admin.group', ['groups' => $groups, 'group' => $group]);
}
示例3: getList
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getList()
{
$groups = Group::orderBy('id', 'asc')->get();
return view('group.list', ['title' => '组列表', 'groups' => $groups]);
}
示例4: getStudentModal
function getStudentModal(Student $student)
{
$data['student'] = $student;
$data['groups'] = [0 => ''] + Group::orderBy('id')->pluck('name', 'id')->all();
return $this->modal('Student bewerken', 'modals.student', $data);
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($society, $id)
{
if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) {
$data['society'] = $society;
$data['roster'] = Roster::with(array('group' => function ($query) {
$query->orderBy('groupname', 'asc');
}))->find($id);
if (count($data['roster']->group) != 0) {
foreach ($data['roster']->group as $group) {
$rostergroup[] = $group->id;
}
$data['rostergroup'] = $rostergroup;
}
$data['groups'] = Group::orderBy('groupname')->get();
if ($data['roster']->extrainfo) {
$extra = explode(',', $data['roster']->extrainfo);
foreach ($extra as $exx) {
$rosterextra[] = intval($exx);
}
$data['rosterextra'] = $rosterextra;
} else {
$data['rosterextra'] = array();
}
if ($data['roster']->multichoice) {
$multi = explode(',', $data['roster']->multichoice);
foreach ($multi as $mul) {
$rostermulti[] = intval($mul);
}
$data['rostermulti'] = $rostermulti;
} else {
$data['rostermulti'] = array();
}
return View::make('rosters.edit', $data);
} else {
return view('shared.unauthorised');
}
}
示例6: groups_roles
public function groups_roles()
{
$data['title'] = "Associate Roles to Groups";
$data['groups'] = Group::orderBy('display_name')->paginate(PAGINATION);
$data['roles'] = Role::orderBy('display_name')->get();
return view('groups/groups_roles', $data);
}
示例7: getEdit
public function getEdit($id)
{
$user = User::find($id);
$departments = Department::orderBy('dw', 'asc')->get();
$majors = Major::orderBy('zy', 'asc')->get();
$groups = Group::orderBy('id', 'asc')->get();
return view('user.edit', ['title' => '编辑用户', 'user' => $user, 'departments' => $departments, 'majors' => $majors, 'groups' => $groups]);
}