I have 2 tables:
USER id, first name, last name
UserUser u_id1, u_id2, date, status
I have 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 for "name", "surname" of the User table, if I add WHERE or Like, it writes an error that the UserUser table of such columns (name, surname) was not found? How to add these two values to search or return a value? I am using Yii2.
source
share