A
A
AlexAll2019-01-24 16:32:56
Yii
AlexAll, 2019-01-24 16:32:56

Why in yii2 dataProvider does not see NULL?

Hi why doesn't dataProvider see 'parent_id' => NULL ?
here is the complete query

$searchModel = new TicketSearch();
 $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        $dataProvider->query->andFilterWhere(['user_id' => Yii::$app->user->id, 'parent_id' => NULL]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2019-01-24
@AlexAll

andFilterWhere seems to work when data is specified, it makes it easier to work with empty search fields, in this case already use andWhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question