2016-10-29 20:04:14 1779次浏览 1条回答 0 悬赏 30 金钱

ListView便利数据就只能是$dataProvider?

/**分类查找*/
        $dataProvider = new ActiveDataProvider([
            'query' => ResourceResources::find()->where(['cat_id' => $cat_id]),
            'pagination' => [
                'pageSize' => 10,
            ],
        ]);

        /**全部数据*/
        $dataAll = new ActiveDataProvider([
            'query' => ResourceResources::find()
                ->where(['in', 'cat_id', ['5', '6', '7', '8', '9', '10', '11', '15', '20']]),
            'pagination' => [
                'pageSize' => 10,
            ],
        ]);
您需要登录后才可以回答。登录 | 立即注册
飒雅
助理

飒雅 北京

注册时间:2016-06-12
最后登录:2019-02-25
在线时长:11小时38分
  • 粉丝6
  • 金钱5
  • 威望0
  • 积分115

热门问题