通过用户ID查询用户微信绑定信息
@param int $userId
@param string $provider
@return null|array
499949
public static function findProviderDataByUserId($userId, $provider)
    {
        $weChat = static::findOne(['user_id' => $userId, 'provider' => $provider]);
        if ($weChat) {
            return $weChat->getDecodedData();
        }
        return null;
    }
47695
public function delete($userId)
    {
        if (is_array($userId)) {
            return $this->batchDelete($userId);
        }

        return $this->httpGet('cgi-bin/user/delete', ['userid' => $userId]);
    }
697776
public function deleteUser($userid)
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/user/delete';

        $result = $this->_curl($apiUrl, [
            'access_token' => $this->getAccessToken(),
            'userid' => $userid,
        ]);

        return $result !== false;
    }
754052
public function authQuery($userId) {
        $data = $this->getAuthQuery()->parameters([
            'identity_param' => Json::encode([
                'userId' => $userId
            ])
        ])->text();
        return isset($data['authorized']) && $data['authorized'];
    }
860320
public function loginUsingId($userId)
    {
        // Find the user using the user id
        try {
            $user = Sentry::findUserById($userId);

            // Log the user in
            Sentry::login($user);

            return $user;
        } catch (UserNotFoundException $e) {
            return null;
        }
    }
506857
public function create($data, $userId = null)
    {
        if (isset($userId)) {
            return $this->client()->put($data, 'users/{userId}', ['userId' => $userId]);
        }

        return $this->client()->post($data, 'users');
    }
1112160
public function searchByUser($userId)
    {
        $query = static::find();
        $query->where(['author_id' => $userId]);
        if (Podium::getInstance()->user->isGuest) {
            $query->joinWith(['forum' => function ($q) {
                $q->where([Forum::tableName() . '.visible' => 1]);
            }]);
        }

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => false,
        ]);
        $dataProvider->sort->defaultOrder = [
            'updated_at' => SORT_DESC,
            'id' => SORT_ASC
        ];

        return $dataProvider;
    }
332699
public function GetAuthentication($UniqueID, $Provider) {
      return $this->SQL->GetWhere('UserAuthentication',
         array('ForeignUserKey' => $UniqueID, 'ProviderKey' => $Provider))->FirstRow(DATASET_TYPE_ARRAY);
   }
817660
public function getAccessTokenList($userId)
    {
        $stmt = $this->db->prepare(
            'SELECT
                provider_id, issued_at, access_token, token_type, expires_in, refresh_token, scope
             FROM access_tokens
             WHERE
                user_id = :user_id'
        );

        $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR);
        $stmt->execute();

        $accessTokenList = [];
        foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
            // convert expires_in to int if it is not NULL
            $row['expires_in'] = null !== $row['expires_in'] ? (int) $row['expires_in'] : null;
            $accessTokenList[] = new AccessToken($row);
        }

        return $accessTokenList;
    }
678114
public static function getUser($userId)
    {
        /** @var \tao_models_classes_UserService $userService */
        $userService = ServiceManager::getServiceManager()->get(\tao_models_classes_UserService::SERVICE_ID);
        $user = $userService->getUserById($userId);
        return $user;
    }
1109647
public function getUserInfo($userid)
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/user/get';

        if ($result = $this->_curl($apiUrl, [
            'access_token' => $this->getAccessToken(),
            'userid' => $userid,
        ])) {
            unset($result['errcode'], $result['errmsg']);
            return $result;
        } else {
            return null;
        }
    }
61191
protected function getLocalUser(string $provider, string $providerUserId)
    {
        return app('cortex.auth.admin')->whereHas('socialites', function (Builder $builder) use ($provider, $providerUserId) {
            $builder->where('provider', $provider)->where('provider_uid', $providerUserId);
        })->first();
    }
203576
public function findForUser($id, $userId)
    {
        return Passport::token()->where('id', $id)->where('user_id', $userId)->first();
    }
1362078
public static function get_providers_preferences($providers, $userid) {
        $preferences = new \stdClass();

        // Get providers preferences.
        foreach ($providers as $provider) {
            foreach (array('loggedin', 'loggedoff') as $state) {
                $linepref = get_user_preferences('message_provider_' . $provider->component . '_' . $provider->name
                    . '_' . $state, '', $userid);
                if ($linepref == '') {
                    continue;
                }
                $lineprefarray = explode(',', $linepref);
                $preferences->{$provider->component.'_'.$provider->name.'_'.$state} = array();
                foreach ($lineprefarray as $pref) {
                    $preferences->{$provider->component.'_'.$provider->name.'_'.$state}[$pref] = 1;
                }
            }
        }

        return $preferences;
    }
833937
public function load($userId)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('contentobject_id', 'ezuser'),
            $this->handler->quoteColumn('login', 'ezuser'),
            $this->handler->quoteColumn('email', 'ezuser'),
            $this->handler->quoteColumn('password_hash', 'ezuser'),
            $this->handler->quoteColumn('password_hash_type', 'ezuser'),
            $this->handler->quoteColumn('is_enabled', 'ezuser_setting'),
            $this->handler->quoteColumn('max_login', 'ezuser_setting')
        )->from(
            $this->handler->quoteTable('ezuser')
        )->leftJoin(
            $this->handler->quoteTable('ezuser_setting'),
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_setting'),
                $this->handler->quoteColumn('contentobject_id', 'ezuser')
            )
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('contentobject_id', 'ezuser'),
                $query->bindValue($userId, null, \PDO::PARAM_INT)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
242150
public function findUser ($userId) {
    $query = $this->database->pdo->prepare('SELECT username, points FROM users WHERE userId = :userId');
    $query->bindParam(':userId', $userId);

    $query->execute();
    return (object) $query->fetch(PDO::FETCH_ASSOC);
  }
1056551
public function get_from_user_id_and_post_ids(int $userid, array $postids) {
        $alias = $this->get_table_alias();
        [$postidinsql, $params] = $this->get_db()->get_in_or_equal($postids);
        $params[] = $userid;

        $wheresql = "{$alias}.postid {$postidinsql}";
        $wheresql .= " AND {$alias}.userid = ?";
        $sql = $this->generate_get_records_sql($wheresql);
        $records = $this->get_db()->get_records_sql($sql, $params);

        return $this->transform_db_records_to_entities($records);
    }