I have 2 tables:
USER id, name, surname
UserUser u_id1, u_id2, date, status
I have here is a model in action USER:
public function getUsers($status)
{
return $this->hasMany(UserUser::className(), ['u_id1' => 'id'])
->where(['status' => $status]);
}
But I need to add the ability to search 'name', 'surname' of the table User, if I add a WHERE or Like, writes an error that the table UserUser such columns (name, surname) not found? How do I add these two values to search or return value? I use Yii2.