protected function findModelUser($id) { $model = User::findOne($id); if ($model->user_type == 2) { return $userModel = UserDlt::findOne($id); } elseif ($model->user_type == 3) { return $userModel = Usercustoms::findOne($id); } elseif ($model->user_type == 5) { return $userModel = UserTourcompany::findOne($id); } }
/** * @return \yii\db\ActiveQuery */ public function getUsercustoms() { return $this->hasMany(Usercustoms::className(), ['user_id' => 'id']); }