I have query in my BlogSearch where i join relation with User. In my Column Rel_User I want to searchin User by his fullname. This is my code of BlogSearch.
$query->joinWith('relUser');//join relationship here
$query->andFilterWhere([
'Id' => $this->Id,
'CreatedAt' => $this->CreatedAt,
]);
$query->andFilterWhere(['like', 'Title', $this->Title])
->andFilterWhere(['like', 'Description', $this->Description])
->andFilterWhere(['like', 'UrUser.Name', $this->Rel_User]);//UrUser is table where i have Name and Surname and there i searching Name but want to search Name and Surname
But now i can search only by user Name. I tried to do this:
$query->andFilterWhere(['like', 'Title', $this->Title])
->andFilterWhere(['like', 'Description', $this->Description])
->andFilterWhere(['like', 'UrUser.Name', $this->Rel_User])
->andFilterWhere(['like', 'UrUser.Surname', $this->Rel_User]);
But it not work for me. How can i create virtual column to connect Name and Surname in one column Search? I This Search is in CRUD in index in GridView