我需要通过 ActiveDataProvider
对象查看,我不明白为什么:
$query = Incarico::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
有效,而这是:
$query = Incarico::find()
->joinWith('allegatos')
->all();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
给我以下错误:
在数组上致电成员函数和佛尔特where()
您不应将all()
应用于$query
,因为ActiveDataProvider
CC_4属性期望有效的ActiveQuery
实例在您传递该查询的结果时。