|
|
@@ -646,11 +646,17 @@ SQL;
|
|
|
$post['type'] = DeclarationForm::TYPE_ZC;
|
|
|
|
|
|
$allData['data'][] = $post;
|
|
|
- if ($formModel->load($allData, '') && $result = $formModel->add()) {
|
|
|
- //发送邮件
|
|
|
- Email::sendRegistrationEmail($post['email'], $post['insertUserName'], $post['password']);
|
|
|
- return static::notice($result);//报单成功
|
|
|
- } else {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if ($formModel->load($allData, '') && $result = $formModel->add()) {
|
|
|
+ //发送邮件
|
|
|
+ Email::sendRegistrationEmail($post['email'], $post['insertUserName'], $post['password']);
|
|
|
+ return static::notice($result);//报单成功
|
|
|
+ } else {
|
|
|
+ return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
|
|
|
+ }
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ LoggerTool::error($e->getMessage() . '; ' . $e->getLine() . '; ' . $e->getFile());
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
|
|
|
}
|
|
|
}
|