title: How to display data of another table in grid view in yii2?
body: <p>In <code>siteController</code> I write query and pass array of <code>dataProvider</code> to <code>index.php</code> to display contain in table form. In <code>index.php</code> I want to display <code>member name</code> instead of <code>memberID</code>. For that I have write inner query and which is successfully run on command prompt successfully.Here I am not able to print <code>first name</code> instead of '<code>member id</code>'</p>
  
  <pre><code>      public function actionIndex()
        {              
       $query = new \yii\db\Query;
        $query-&gt;select(['member.firstName',
                      'complaint.practiceCode','complaint.id',
                      'complaint.description','member.firstName'])
             -&gt;from(['complaint'])
             -&gt;innerJoin(['member','complaint.memberID = member.id'])
             -&gt;groupBy(['complaint.id'])
             -&gt;where(['complaint.deleted' =&gt; 'N']);
       $query-&gt;createCommand();
  </code></pre>
  
  <p>Here I have pass data by creating  <code>$dataProvider4</code> but I am not able to set value  of <code>firstName</code> instead of <code>memberID</code>.</p>
  
  <pre><code>      $dataProvider4= new ActiveDataProvider([
              'query' =&gt; $query,
              'pagination' =&gt; false,
         ]);
  
          return $this-&gt;render('index', [
         'dataProvider4'=&gt;$dataProvider4]);
  
  &lt;?= GridView::widget([
      'dataProvider'=&gt;$dataProvider4,
      'summary'=&gt;'Total'.'&amp;nbsp&lt;b&gt;'.$complaintModel.'&lt;/b&gt;&amp;nbsp'.'Complaints',
      'columns' =&gt; [
         ['class' =&gt; 'yii\grid\SerialColumn'],
             'practiceCode',
              // 'memberID',
              'description',
              'status',
         ],
      ]); ?&gt;
  </code></pre>
  
  <p>I have pass data through the dataProvider. </p>