title: Yii2. How to get access to the subquery field in a search model?
body: <p>I have a search model:</p>
  
  <pre><code>$query = User::find();
  $myOrdersQuery = Request::find()
                              -&gt;select('count(*)')
                              -&gt;where([
                                  'user_id' =&gt; $clientsIds,
                                  'agent_id' =&gt; $this-&gt;viewer-&gt;id,
                              ]);
  $query-&gt;addSelect(['my_orders_count' =&gt; $myOrdersQuery]);
  </code></pre>
  
  <p>When I'm trying to print it into the GridView</p>
  
  <pre><code>        [
              'attribute' =&gt; 'my_orders_count',
              'value' =&gt; function ($model) {
                  return $model-&gt;my_orders_count;
              }
          ],
  </code></pre>
  
  <p>it says Getting unknown property: common\models\User::my_orders_count</p>
  
  <p>Please help to get access to this field</p>