當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。