diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 93ef047..fda37a0 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -2,9 +2,11 @@ namespace frontend\controllers; use common\models\Cities; +use common\models\CompanyInfo; use common\models\Country; use common\models\Specialization; use common\models\UserInfo; +use Faker\Provider\is_IS\Company; use Yii; use common\models\LoginForm; use frontend\models\PasswordResetRequestForm; @@ -258,6 +260,15 @@ class SiteController extends Controller $user_info->save(); + if($user->type == 2 ){ + + $company_info = new CompanyInfo(); + $company_info->load(Yii::$app->request->post(),'SignupForm'); + $company_info->name = $user->id; + + $user_info->save(); + } + if (Yii::$app->getUser()->login($user)) { return $this->goHome(); } diff --git a/frontend/models/SignupForm.php b/frontend/models/SignupForm.php index 7e502f9..046a0cc 100755 --- a/frontend/models/SignupForm.php +++ b/frontend/models/SignupForm.php @@ -21,7 +21,7 @@ class SignupForm extends Model public $is_customer; public $is_freelancer; public $city; - public $company_name; + public $name; /** * @inheritdoc @@ -42,7 +42,7 @@ class SignupForm extends Model ['email', 'string', 'max' => 255], ['email', 'unique', 'targetClass' => '\common\models\User', 'message' => 'This email address has already been taken.'], - ['company_name', 'required'], + ['name', 'required'], ['firstname', 'required'], @@ -97,7 +97,7 @@ class SignupForm extends Model 'alt_location' => 'Город не в списке', 'is_customer' => '', 'is_freelancer' => '', - 'company_name' => 'Название компании' + 'name' => 'Название компании' ]; } diff --git a/frontend/views/site/registration.php b/frontend/views/site/registration.php index d8b414b..bb19986 100644 --- a/frontend/views/site/registration.php +++ b/frontend/views/site/registration.php @@ -89,7 +89,7 @@
- field($model, 'company_name')->textInput(['class'=>'custom-input-2'])?> + field($model, 'name')->textInput(['class'=>'custom-input-2'])?>
-- libgit2 0.21.4