當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserModel::getById方法代碼示例

本文整理匯總了PHP中UserModel::getById方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserModel::getById方法的具體用法?PHP UserModel::getById怎麽用?PHP UserModel::getById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserModel的用法示例。


在下文中一共展示了UserModel::getById方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: user

 protected function user()
 {
     if (!isset($this->user)) {
         $user = new UserModel();
         $this->user = $user->getById($this->aAttributes['user_id']);
     }
     return $this->user;
 }
開發者ID:Abyss403,項目名稱:test,代碼行數:8,代碼來源:PostModel.php

示例2: edit

 /**
  * 編輯用戶信息
  */
 function edit()
 {
     //得到傳來的ID得到用戶信息
     $user_id = trim($_GET['id']);
     $users = new UserModel();
     $list = $users->getById($user_id);
     $this->assign('user_list', $list);
     $this->display();
 }
開發者ID:omusico,項目名稱:AndyCMS,代碼行數:12,代碼來源:UserAction.class.php

示例3: getAllUsers

 public function getAllUsers()
 {
     $userModel = new UserModel();
     $database = new Database();
     $allId = $this->getAllId($database);
     $allUsers = array();
     foreach ($allId as $id) {
         array_push($allUsers, $userModel->getById($id));
     }
     return $allUsers;
 }
開發者ID:alexandre-le-borgne,項目名稱:-PHP-DUT-S3-Projet,代碼行數:11,代碼來源:AdminModel.php

示例4: getById

 static function getById($id)
 {
     if (!$id) {
         return false;
     }
     $model = new UserModel();
     $result = $model->getById($id);
     if (!$result) {
         return false;
     }
     return $result[0];
 }
開發者ID:jianchengdu,項目名稱:dangjia,代碼行數:12,代碼來源:UserData.php

示例5: isGranted

 public function isGranted($role)
 {
     $session = Request::getInstance()->getSession();
     $model = new UserModel();
     switch ($role) {
         case self::USER_IS_INACTIVE:
             $user = $model->getById($session->getInstance()->get('id'));
             if ($user) {
                 return !$user->getActive();
             }
             break;
         case self::USER_IS_ADMIN:
             if ($session->isConnected()) {
                 $user = $model->getById($session->get('id'));
                 return $user->getAccountLevel() == UserModel::ACCOUNT_LEVEL_ADMIN;
             }
             break;
         case self::USER_IS_CONNECTED:
             return $session->isConnected();
         case self::USER_IS_NOT_CONNECTED:
             return true;
     }
     return false;
 }
開發者ID:alexandre-le-borgne,項目名稱:-PHP-DUT-S3-Projet,代碼行數:24,代碼來源:Session.php

示例6: UserloginAddlog

 static function UserloginAddlog($id)
 {
     $userlogin = new UserLoginModel();
     $user = new UserModel();
     $udata = $user->getById($id);
     $data = array('uid' => $id, 'updated' => time(), 'updateip' => Tool_Fnc::realip(), 'fqy' => 1);
     if ($fqy = Member::LoginToday($id)) {
         if ($fqy['s'] == 1) {
             $data['fqy'] = $fqy['fqy'] + 1;
         } elseif ($fqy['s'] == 0) {
             $data['fqy'] = $fqy['fqy'];
         }
     }
     $userlogin->insert($data);
     //添加登陸日誌
     $type = self::$type;
     if ($fqy) {
         if ($fqy['s'] == 1) {
             if ($data['fqy'] <= 10) {
                 $credit = $data['fqy'] * 10;
             } else {
                 $credit = 100;
             }
             self::AddCredit($id, $credit);
             self::AddLevelLog($id, 1, $credit, $data['fqy']);
         } elseif ($fqy['s'] == 0) {
             //同一天
             //$credit = 10;
         }
     } else {
         //第一次
         $credit = 10;
         self::AddCredit($id, $credit);
         self::AddLevelLog($id, 1, $credit, $data['fqy']);
     }
 }
開發者ID:tanqinwang,項目名稱:test_own,代碼行數:36,代碼來源:Member.php

示例7: addmoney

 public function addmoney()
 {
     $userid = I('id', NULL);
     $user = new UserModel();
     $data = $user->getById($userid);
     if (!empty($userid)) {
         $this->assign('data', $data);
         $this->display();
     } else {
         $this->message2('非法操作', __APP__ . '/Admin');
     }
 }
開發者ID:kwdwkiss,項目名稱:kongbao8,代碼行數:12,代碼來源:UserAction.class.php


注:本文中的UserModel::getById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。