小编alz*_*mbo的帖子

使用 - > all()的Yii 2 ActiveDataProvider查询给出"调用数组上的成员函数andFilterWhere()"错误

我需要传递ActiveDataProvider对象来查看,我无法理解为什么这样:

$query = Incarico::find();

$dataProvider = new ActiveDataProvider([
    'query' => $query,
]);
Run Code Online (Sandbox Code Playgroud)

工作,而这:

$query = Incarico::find()
    ->joinWith('allegatos')           
    ->all();

$dataProvider = new ActiveDataProvider([
    'query' => $query,
]);
Run Code Online (Sandbox Code Playgroud)

给我以下错误:

在数组上调用成员函数andFilterWhere()

php yii2

2
推荐指数
1
解决办法
5013
查看次数

标签 统计

php ×1

yii2 ×1