Helo,有人可以向我解释为什么我会收到此错误吗?我正在做的是,我正在尝试GridView根据进行过滤id's,但它显示了此错误消息。我尝试搜索相关信息,但找不到有用的信息。
这是我的Search功能:
public function search($params)
{
$query = Sale::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$query->joinWith('item');
$dataProvider->setSort([
'attributes' => [
'id',
'customer_name',
'customer_surname',
'customer_phone',
'customer_email',
'code',
'comment',
'sign',
'price' => [
'asc' =>['item.price' => SORT_ASC],
'desc' =>['item.price' => SORT_DESC],
],
'item_id' => [
'asc' =>['item.name' => SORT_ASC],
'desc' =>['item.name' => SORT_DESC],
]
]
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records …Run Code Online (Sandbox Code Playgroud) yii2 ×1