A project of mine does something similar:
MANY_MANY relation between shop and card, this dataprovider is used to display a list of shops linked to a specific card:
$shopDataProvider=new CActiveDataProvider( 'Shop',
array(
'criteria'=>array(
'with'=>array('cardShop'),
'condition'=>'cardShop.card_id=:cardId',
'params'=>array(':cardId'=>$id),
'order'=>'t.id DESC',
'together'=>true,
),
)
);