diff --git a/common/models/Team.php b/common/models/Team.php index 9e8bb58..edd96b7 100644 --- a/common/models/Team.php +++ b/common/models/Team.php @@ -13,7 +13,7 @@ * @property integer $user_id * @property string $firstname * @property string $lastname - * @property string $midlename + * @property string $middlename * @property string $link * @property string $position * @property integer $department_id @@ -85,7 +85,7 @@ [ 'firstname', 'lastname', - 'midlename', + 'middlename', 'link', 'position', 'photo', @@ -107,7 +107,7 @@ 'user_id' => Yii::t('app', 'User ID'), 'firstname' => Yii::t('app', 'Имя'), 'lastname' => Yii::t('app', 'Фамилия'), - 'midlename' => Yii::t('app', 'Отчество'), + 'middlename' => Yii::t('app', 'Отчество'), 'link' => Yii::t('app', 'Ссылка на профиль МФП'), 'position' => Yii::t('app', 'Должность'), 'department_id' => Yii::t('app', 'Отдел компании'), diff --git a/console/migrations/m160208_101449_team.php b/console/migrations/m160208_101449_team.php index d6cc451..fbf7e62 100644 --- a/console/migrations/m160208_101449_team.php +++ b/console/migrations/m160208_101449_team.php @@ -17,7 +17,7 @@ class m160208_101449_team extends Migration 'link' => $this->string(255), 'position' => $this->string(255)->notNull(), 'department_id' => $this->integer()->notNull(), - 'experience_from' => $this->timestamp(), + 'experience_from' => $this->integer(), 'date_add' => $this->timestamp()->notNull(), 'user_add_id' => $this->integer(), 'photo' => $this->string(255), diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index b391fe1..36231a8 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -2,6 +2,7 @@ namespace frontend\controllers; use common\models\Cities; +use common\models\Country; use common\models\Specialization; use common\models\UserInfo; use Yii; @@ -69,6 +70,24 @@ class SiteController extends Controller return $out; } + public function actionCountry($q = null, $id = null) { + \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; + $out = ['results' => ['id' => '', 'text' => '']]; + if (!is_null($q)) { + $query = new Query; + $query->select('country_name AS id, country_name AS text') + ->from('country') + ->where(['like', 'lower(country_name)', mb_strtolower($q) ]) + ->limit(20); + $command = $query->createCommand(); + $data = $command->queryAll(); + $out['results'] = array_values($data); + } + elseif ($id > 0) { + $out['results'] = ['id' => $id, 'text' => Country::find($id)->country_name]; + } + return $out; + } public function actionFormsModal() { diff --git a/frontend/views/accounts/_projects_form.php b/frontend/views/accounts/_projects_form.php index 4eeaa35..7e80c66 100644 --- a/frontend/views/accounts/_projects_form.php +++ b/frontend/views/accounts/_projects_form.php @@ -1,16 +1,18 @@ title = 'Мой профиль'; @@ -29,15 +31,29 @@ ->textInput() ?> = $form->field($project, 'project_pid') - ->dropDownList($projects, ['prompt' => 'Родительский проект']) ?> + ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?> = $form->field($project, 'specializationInput') ->checkboxList($specialization) ?>