Пример #1
0
 public function findUserAttr($id)
 {
     $model = Userlogin::find()->select('*')->joinWith('emp', true, 'LEFT JOIN')->Where(['wnd_admin.user.id' => $id]);
     //->one();
     if ($model !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #2
0
 public function getUser()
 {
     return $this->hasOne(Userlogin::className(), ['EMP_ID' => 'EMP_ID']);
 }
Пример #3
0
 /**
  * CLASS TABLE FIND PrimaryKey
  * Example:  Employe::find()
  */
 protected function findModel($id)
 {
     if (($model = Userlogin::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }