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