/** * findUserAttr User and Employe * @author ptrnov <*****@*****.**> * @since 1.1 */ public function findUserAttr($id) { $model = Userlogin::find()->select('*')->joinWith('userprofile', true, 'LEFT JOIN')->Where(['dbm001.user.id' => $id]); //->one(); if ($model !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function getUser() { return $this->hasOne(Userlogin::className(), ['id' => 'USER_ID']); }