I’ve been working with Yii for two months now and since this is my first forum post I did not have that much troubles to get along with it. Currently I am stuck with the translation of a rather simple MySql query to Yii:
select * from projects p, projectparticipants pp
where
p.projectleader_id = 100 or
(pp.project_id = p.id and pp.participant_id = 100)
I need this query as CDbCriteria which is used in a CActiveDataProvider object for a GridView (zii.widgets.grid.CGridView).
This GridView is supposed to show all projects which have something to do with a certain user (either being a project’s leader or being participant in another leader’s project).
There might be the possiblitiy to use Yii::app()->db->createCommand() and not using a CActiveDataProvider but a different one (like CArrayDataProvider), but in my code there are several configurations for the dataprovider and all of them work together with CActiveDataProvider and CDbCriteria …
Does anyboy have got a clue how to handle this problem?