title: how to display records in dataprovider of yii?
body: <p>I want to use this query in dataprovider</p>
  <pre><code>select user.username ,company_user.* from user left join company_user on company_user.user_id=user.id where company_user.company_id=&quot;.$id
  </code></pre>
  <p>how to write in CActiveDataProvider</p>
  <p>plz help me
  Thank in advance...</p>
  <p>I have 3 tables<br>
  <strong>company_user</strong>-&gt;id,company_id,user_id,first_name,last_name<br>
  <strong>company</strong>-&gt;id,name_of_company<br>
  <strong>user</strong>-&gt;id,username,password<br></p>
  <p>I want all records from <strong>company_user</strong> + username from <strong>user</strong></p>
  <p>Thanks in advance...:)</p>
  <p>i want list in CGridView</p>
  <p>in my user model I have written this type of relations</p>
  <pre><code>public function relations()
      {
          // NOTE: you may need to adjust the relation name and the related
          // class name for the relations automatically generated below.
          return array(
              'company_user'          =&gt;array(self::HAS_ONE,'CompanyUser','user_id','select' =&gt;array('first_name','status'),
                                              'with'=&gt;array('company'=&gt;array(self::BELONGS_TO, 'Company', 'company_id','joinType' =&gt; 'INNER JOIN')),
                                      ),
              'company_user_rel_only' =&gt;array(self::HAS_ONE,'CompanyUser','user_id','select' =&gt;array('first_name', 'last_name')),
              
      }
  </code></pre>