/** * 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(); }
/** * Finds an account by id. * * @param int $id * * @return models\Account|null */ public function findAccountById($id) { return $this->accountQuery->where(['id' => $id])->one(); }
/** * @return AccountQuery */ public static function find() { return Yii::createObject(AccountQuery::className(), [get_called_class()]); }