innerJoin("user_account_assignment",'product.id_account = user_account_assignment.id_account' ); $query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]); } $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'product.id_product_category' => $this->id_product_category, 'product.id_account' => $this->id_account, 'product.status' => $this->status, ]); $query->andFilterWhere(['like', 'product_number', $this->product_number]) ->andFilterWhere(['like', 'barcode', $this->barcode]); return $dataProvider; } }