title: ActiveDataProvider:"query" property must be instance of a class that implements the QueryInterface
body: <p>i am using an self-defined func that encapsu findBySql() to return rows .but got the error showed in the title. but if i test to use self-defined func that encapsu find() ,it worked,why?</p>
  
  <p>Here is my action:</p>
  
  <pre><code>public function actionList()
  {
       $model = new Loan();
       $dataProvider = new ActiveDataProvider(
       [
          'query' =&gt; $model-&gt;findValid($_GET['type']),//error comes here
          'pagination' =&gt; [
                          'pagesize' =&gt; '2',
           ],
       ]);
  
        return $this-&gt;renderPartial('list', ['model' =&gt; $model, 'dataProvider' =&gt; $dataProvider]);
  }
  </code></pre>
  
  <p>Here is the object loan's findxx function:</p>
  
  <pre><code> public function findValid($type=null)
  {
      if($type==null){
              return static::findBySql("select * from loan where wmstat&amp;1=1 and (wmstat&gt;&gt;2)&amp;1=0")-&gt;all();
      }else{
              return static::findBySql("select * from loan where wmstat&amp;1=1 and (wmstat&gt;&gt;2)&amp;1=0 and origin="."'".$type."'")-&gt;all();
      }
  }
  </code></pre>
  
  <p>Futher more,can i change the bit operatin using find() and where() and achieve the same effect ?</p>