diff --git a/common/models/CompanyInfo.php b/common/models/CompanyInfo.php index 63b6289..a0d8cf4 100755 --- a/common/models/CompanyInfo.php +++ b/common/models/CompanyInfo.php @@ -11,7 +11,6 @@ * @property integer $staff * @property string $street * @property string $house - * @property integer $hide_mail */ class CompanyInfo extends \yii\db\ActiveRecord { @@ -45,10 +44,6 @@ 'string', ], [ - [ 'hide_mail' ], - 'integer', - ], - [ [ 'staff' ], 'default', 'value' => 1, @@ -72,7 +67,6 @@ 'staff' => Yii::t('app', 'Количество сотрудников'), 'street' => Yii::t('app', 'Улица'), 'house' => Yii::t('app', 'Дом'), - 'hide_mail' => Yii::t('app', 'не публиковать Email'), ]; } } diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index e00b6d5..1af7f1b 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -30,6 +30,7 @@ * @property string $geography * @property integer $salary_currency * @property string $email + * @property integer $hide_mail */ class UserInfo extends \yii\db\ActiveRecord { @@ -215,6 +216,17 @@ ], 'email', ], + [ + [ 'hide_mail' ], + 'integer', + 'min' => 0, + 'max' => 1, + ], + [ + ['hide_mail'], + 'default', + 'value' => 0, + ] ]; } @@ -268,6 +280,7 @@ 'salary_currency' => Yii::t('app', 'Валюта'), 'is_customer' => '', 'is_freelancer' => '', + 'hide_mail' => Yii::t('app', 'не публиковать Email'), ]; } diff --git a/console/migrations/m160309_124241_add_vacancy_status.php b/console/migrations/m160309_124241_add_vacancy_status.php new file mode 100644 index 0000000..6af8b6d --- /dev/null +++ b/console/migrations/m160309_124241_add_vacancy_status.php @@ -0,0 +1,16 @@ +addColumn('{{%vacancy}}', 'status', $this->integer()->defaultValue(1)); + } + + public function down() + { + $this->dropColumn('{{%vacancy}}', 'status'); + } +} diff --git a/console/migrations/m160310_080610_hide_email_to_user_info.php b/console/migrations/m160310_080610_hide_email_to_user_info.php new file mode 100644 index 0000000..68c0b0e --- /dev/null +++ b/console/migrations/m160310_080610_hide_email_to_user_info.php @@ -0,0 +1,18 @@ +dropColumn('{{%company_info}}', 'hide_mail'); + $this->addColumn('{{%user_info}}', 'hide_mail', $this->smallInteger()->defaultValue(0)); + } + + public function down() + { + $this->dropColumn('{{%user_info}}', 'hide_mail'); + $this->addColumn('{{%company_info}}', 'hide_mail', $this->smallInteger()->defaultValue(0)); + } +} diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index fb1b6f0..77e332f 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -176,7 +176,7 @@ ?>