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


PHP Group::orderBy方法代码示例

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


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

示例1: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(General $general, User $user)
 {
     $theme = $general->theme();
     $registration_links = RegistrationLink::valid()->get();
     $groups = Group::orderBy('role_id')->lists('name', 'id');
     $theme['title'] = 'Create User';
     $theme['description'] = 'Here you generate link which will be used by another user for sign up';
     $button_text = 'Generate User Register Link';
     return view('admin.user.create', compact('theme', 'user', 'registration_links', 'groups', 'button_text'));
 }
开发者ID:ronal2do,项目名称:Laravel-CMS,代码行数:15,代码来源:UserController.php

示例2: index

 /**
  * Main HOMEPAGE
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if (Auth::check()) {
         $groups = \App\Group::with('membership')->orderBy('name')->paginate(50);
         $my_groups = Auth::user()->groups()->orderBy('name')->get();
         $my_groups_id = false;
         // using this array we can adjust the queries after to only include stuff the user has
         // might be a good idea to find a clever way to build this array of groups id :
         foreach ($my_groups as $the_group) {
             $my_groups_id[] = $the_group->id;
         }
         $my_discussions = \App\Discussion::with('userReadDiscussion', 'user', 'group')->whereIn('group_id', $my_groups_id)->orderBy('updated_at', 'desc')->paginate(10);
         $my_actions = \App\Action::with('user', 'group')->whereIn('group_id', $my_groups_id)->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         $other_discussions = \App\Discussion::with('userReadDiscussion', 'user', 'group')->whereNotIn('group_id', $my_groups_id)->orderBy('updated_at', 'desc')->paginate(10);
         $other_actions = \App\Action::with('user', 'group')->whereNotIn('group_id', $my_groups_id)->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         return view('dashboard.homepage')->with('groups', $groups)->with('my_groups', $my_groups)->with('my_discussions', $my_discussions)->with('my_actions', $my_actions)->with('other_actions', $other_actions)->with('other_discussions', $other_discussions);
     } else {
         $groups = \App\Group::orderBy('name')->paginate(50);
         $other_discussions = \App\Discussion::with('user', 'group')->orderBy('updated_at', 'desc')->paginate(10);
         $other_actions = \App\Action::with('user', 'group')->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         $my_groups = false;
         return view('dashboard.homepage')->with('groups', $groups)->with('my_groups', $my_groups)->with('other_discussions', $other_discussions)->with('other_actions', $other_actions);
     }
 }
开发者ID:philippejadin,项目名称:Mobilizator,代码行数:29,代码来源:DashboardController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $groups = Group::orderBy('name')->get();
     return view('groups.index', compact('groups'));
 }
开发者ID:vespan,项目名称:grupr,代码行数:10,代码来源:GroupsController.php

示例4: leagueData

 protected function leagueData()
 {
     $committees = Committee::where('active', 1)->orderBy('name')->get();
     $positions = Position::all();
     $requirements = $this->currentYearBaseReqs();
     $teams = Team::where('active', 1)->orderBy('name')->get();
     $groups = Group::orderBy('name')->get();
     $roles = Role::orderBy('name')->get();
     return array('committees' => $committees, 'positions' => $positions, 'requirements' => $requirements, 'teams' => $teams, 'groups' => $groups, 'roles' => $roles);
 }
开发者ID:staciewilhelm,项目名称:denver-member-tracking,代码行数:10,代码来源:MemberController.php


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