Exemplo n.º 1
0
 public function actionIndex()
 {
     $user = Yii::$app->session->get('user');
     if (Info::checkUserRecordOrPass($user['userId'])) {
         //判断用户是否已经填报过
         return $this->redirect(['sign-up/over']);
     }
     $signUpForm = new SignUpForm();
     if ($info = Info::findRefusedByUserId($user['userId'])) {
         CommonFunctions::createAlertMessage("工作人员帮您填写报名信息失败,请仔细检查报名信息,然后完善后再次提交。\n            <br>失败原因是:" . $info->replyContent, "error");
     } else {
         CommonFunctions::createAlertMessage("‘帮我报名’是‘云豆讲堂’为用户提供的增值服务,根据用户在线提交的信息,\n            由工作人员协助在主管部门进行报名。由于牵涉到考试信息的准确性,请您确保提供的信息准确无误。\n            由于提交需要用到个人照片(像素:102*126)与学历证书扫描件(像素:650*500),请按规定提交。", "info");
     }
     if (Yii::$app->request->isPost) {
         if ($signUpForm->loadPost($signUpForm) && $signUpForm->validate()) {
             $signUpForm->record();
             return $this->redirect(['sign-up/over']);
         }
     }
     return $this->render('index', ['signUpForm' => $signUpForm]);
 }
Exemplo n.º 2
0
 public function validateIDCard($attribute)
 {
     if (Info::checkUserRecordOrPass($this->userId)) {
         $this->addError($attribute, '该身份证已经记录过或已报名成功');
     }
 }