title: Retrieve a CActiveDataProvider with a criteria in yii
body: <p>I'm starting with yii and I have some trouble when trying to filter an CActiveDataProvider with a criteria. </p>
  
  <p>This is my database model:</p>
  
  <pre><code>Table            Columns
  Project          [id, name, status]
  userToProject    [user_id,project_id,role]
  User             [id , ....]
  </code></pre>
  
  <p>And I'd like the <strong>index</strong> action to show all the projects with status=finished or where the user is currently assigned to that project.</p>
  
  <p>So hard-coding the user id for testing purposes. This is my code:</p>
  
  <pre><code>$criteria=array(
              'order'=&gt;'status desc',
              'with'=&gt;array(
                 'userToProject','userToProject.user'=&gt;array('alias'=&gt;'user')),
      );
  $criteria['condition']='status=='.Project::STATUS_FINISHED;
  $criteria['condition'].=' OR user.id = 6';
  $dataProvider=new CActiveDataProvider('Project', array(
              'criteria'=&gt;$criteria,
      ));
  $this-&gt;render('index',array(
              'dataProvider'=&gt;$dataProvider,
      ));
  </code></pre>
  
  <p>But it throws an Exception saying <strong>Unknown column 'user.id</strong>. What am I missing? Thanks</p>
  
  <p>Edit: The error code is:</p>
  
  <pre><code> Column not found: 1054
   Unknown column 'users.user_id' in 'where clause'. The SQL statement executed was: 
   SELECT `t`.`id` AS `t0_c0`, `t`.`name` AS `t0_c1`, `t`.`description` AS `t0_c2`, 
   `t`.`status` AS `t0_c3`, `t`.`creation_date` AS `t0_c4` FROM `pgp_project` `t` WHERE
    (status=4 OR users.user_id=6) ORDER BY status desc LIMIT 10
  </code></pre>