diff --git a/common/models/Portfolio.php b/common/models/Portfolio.php index d6b2e97..6f11514 100644 --- a/common/models/Portfolio.php +++ b/common/models/Portfolio.php @@ -22,6 +22,7 @@ * @property string $description * @property string $cover * @property integer $gallery_id + * @property string $preview * @property PortfolioSpecialization[] $portfolioSpecializations * @property Specialization[] $specializations */ @@ -65,6 +66,7 @@ [ [ 'name', + 'preview', ], 'required', ], @@ -94,6 +96,13 @@ ], [ [ + 'preview', + ], + 'string', + 'max' => 1000, + ], + [ + [ 'specializationInput', ], 'safe', @@ -167,4 +176,9 @@ { $this->specializationString = $value; } + + public function getGallery() + { + $this->hasOne(Gallery::className(), ['gallery_id' => 'gallery_id']); + } } diff --git a/common/models/User.php b/common/models/User.php index fe8a81b..ec624c6 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -541,4 +541,9 @@ return $this->hasMany(Vacancy::className(), [ 'user_id' => 'id' ]); } + public function getGalleries() + { + return $this->hasMany(Gallery::className(), [ 'user_id' => 'id' ]); + } + } diff --git a/common/models/Vacancy.php b/common/models/Vacancy.php index 3cae640..4818e66 100644 --- a/common/models/Vacancy.php +++ b/common/models/Vacancy.php @@ -95,6 +95,11 @@ 'string', 'max' => 255, ], + [ + ['phone'], + 'match', + 'pattern' => '/^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$/', + ], ]; } diff --git a/common/widgets/views/phone_field.php b/common/widgets/views/phone_field.php index 4f70a07..4b13455 100644 --- a/common/widgets/views/phone_field.php +++ b/common/widgets/views/phone_field.php @@ -20,7 +20,7 @@ = Html::beginTag('div',['class'=>'form-group','id'=>isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ])?>
Для создания галереи перейдите по " . Html::a('ссылке', [ 'accounts/gallery-create' ], [ 'target' => '_BLANK' ]) . "
") + ->dropDownList($galleries, [ 'prompt' => 'Выберите галерею' ]) ?> +