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


PHP User::orderBy方法代码示例

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


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

示例1: loadUserInfo

 public function loadUserInfo()
 {
     $sort3 = null;
     /*
      * Sorting
      */
     switch ($this->sort) {
         case 'group':
             $sort1 = 'primary_usergroup';
             $sort2 = 'surname';
             $sort3 = 'name';
             break;
         case 'given':
             $sort1 = 'name';
             $sort2 = 'surname';
             break;
         default:
             $sort1 = 'surname';
             $sort2 = 'name';
     }
     $people = user::orderBy($sort1)->orderBy($sort2);
     if ($sort3) {
         $people->orderBy($sort3);
     }
     $this->people = $people->get();
     return $this->people;
 }
开发者ID:aydancoskun,项目名称:octobercms,代码行数:27,代码来源:UserList.php

示例2: render

 /**
  * {@inheritDoc}
  */
 public function render()
 {
     $limit = $this->property('limit');
     $users = User::orderBy('points_today', 'DESC')->take($limit)->get();
     $this->vars['users'] = $users;
     return $this->makePartial('widget');
 }
开发者ID:janusnic,项目名称:OctoberFriends,代码行数:10,代码来源:FriendsLeaderboard.php

示例3: getUserOptions

 public function getUserOptions()
 {
     $users = user::orderBy('surname')->orderBy('name')->get();
     foreach ($users as $user) {
         $people[$user['id']] = $user['surname'] . ', ' . $user['name'] . '<' . $user['email'] . '>';
     }
     return $people;
 }
开发者ID:aydancoskun,项目名称:octobercms,代码行数:8,代码来源:Merge.php

示例4: run

 public function run()
 {
     //
     // @todo
     //
     // Add a Welcome post or something
     //
     Category::create(['name' => trans('rainlab.blog::lang.categories.uncategorized'), 'slug' => 'uncategorized']);
     IMsg::create(['user_id' => User::orderBy('id', 'desc')->first()->id, 'content' => '初始化信息第一条']);
 }
开发者ID:hushulin,项目名称:imdemo,代码行数:10,代码来源:seed_all_tables.php

示例5: getUserIdOptions

 public function getUserIdOptions($keyValue = null)
 {
     $manager = PluginManager::instance();
     if ($manager->exists('rainlab.user')) {
         $Users = array();
         foreach (UserModel::orderBy('surname')->orderBy('name')->get() as $user) {
             $Users[$user->id] = $user->surname . ', ' . $user->name;
         }
         return $Users;
     }
     return [0 => 'Rainlab User Model Not Installed'];
 }
开发者ID:ardani,项目名称:MyCalendar,代码行数:12,代码来源:Event.php

示例6: getUserIdOptions

 public function getUserIdOptions($keyValue = null)
 {
     $manager = PluginManager::instance();
     if ($manager->exists('rainlab.user')) {
         foreach (UserModel::orderBy('surname')->orderBy('name')->get() as $user) {
             $Users[$user->id] = $user->surname . ', ' . $user->name;
         }
         return $Users;
     }
     return [0 => 'kurtjensen.mycalendar::lang.event.error_user_model'];
 }
开发者ID:ribsousa,项目名称:MyCalendar,代码行数:11,代码来源:Event.php


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