I found a good solution. I use the model, which I want to display. In this case, an administrator is an user.
Now I join the tables manually.
$dataProvider_admins = new CActiveDataProvider('User', array(
'criteria' => array(
'join' => 'LEFT JOIN `{{company_user}}` ON `id` = `user_id` AND `company_id` = '.intval($company->id),
'with' => array('profile'),
),
'pagination' => array(
'pageSize' => 20,
),
));
The whole CActiveDataProvider will be returned by the Company
model, so it is logical encapsulated.
$dataProvider = Company::model()->find('id=5')->adminsDataProvider;
I hope the solutions helps somebody.