我在我的BlogSearch中查询,我加入与用户的关系。在我的专栏用户中,我想通过他的全名搜索用户。这是我的BlogSearch代码。在一个列搜索全名搜索
$query->joinWith('relUser');
$query->andFilterWhere([
'Id' => $this->Id,
'CreatedAt' => $this->CreatedAt,
]);
$query->andFilterWhere(['like', 'Title', $this->Title])
->andFilterWhere(['like', 'Description', $this->Description])
->andFilterWhere(['like', 'User.Name', $this->Rel_User])
->andFilterWhere(['like', 'User.Surname', $this->Rel_User]);
什么意思不工作,,错误,,错误的结果?..请显示所有的搜索模型 – scaisEdge
我怎样才能将我的列连接成一个? – qwerty
你想在哪里连接列,,, sqlquery? ,,, gridview列)?更正你的问题,并有适当的解释,并显示你的相关searchModel,controllerAction和查看请.. – scaisEdge