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


PHP Group::orderBy方法代码示例

本文整理汇总了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);
 }
开发者ID:bishopm,项目名称:circuit,代码行数:13,代码来源:SettingsController.php

示例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]);
 }
开发者ID:Quiss,项目名称:Twiga,代码行数:28,代码来源:AdminGroupController.php

示例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]);
 }
开发者ID:rxfu,项目名称:jspx,代码行数:10,代码来源:GroupController.php

示例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);
 }
开发者ID:robindv,项目名称:WebDB,代码行数:6,代码来源:StaffController.php

示例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');
     }
 }
开发者ID:bishopm,项目名称:circuit,代码行数:43,代码来源:RostersController.php

示例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);
 }
开发者ID:pinkynrg,项目名称:convergence2.0,代码行数:7,代码来源:GroupsController.php

示例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]);
 }
开发者ID:rxfu,项目名称:jspx,代码行数:8,代码来源:UserController.php


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