예제 #1
0
 /**
  * Finds an account by id.
  *
  * @param int $id
  *
  * @return models\Account|null
  */
 public function findAccountById($id)
 {
     /**
      * xiaoma update;
      */
     // $clientId = 0;
     // $provider = $client->getId();
     // switch($provider){
     //     case 'qq' : $clientId = $client->getUserAttributes()['openid'];break;
     //     case 'sina' : $clientId = $client->getUserAttributes()['uid'];break;
     //     default: $clientId = $client->getUserAttributes()['id'];break;
     // }
     // return $this->accountQuery->where([
     //     'provider'  => $provider,
     //     'client_id' => $clientId,
     // ])->one();
     return $this->accountQuery->where(['id' => $id])->one();
 }
예제 #2
0
 /**
  * Finds an account by id.
  *
  * @param int $id
  *
  * @return models\Account|null
  */
 public function findAccountById($id)
 {
     return $this->accountQuery->where(['id' => $id])->one();
 }
예제 #3
0
파일: Account.php 프로젝트: 88c/yii2-user
 /**
  * @return AccountQuery
  */
 public static function find()
 {
     return Yii::createObject(AccountQuery::className(), [get_called_class()]);
 }