diff --git a/common/behaviors/ShowImage.php b/common/behaviors/ShowImage.php
index 0198027..2b9b812 100644
--- a/common/behaviors/ShowImage.php
+++ b/common/behaviors/ShowImage.php
@@ -9,7 +9,7 @@ class ShowImage extends Behavior
{
function minImg($dir, $width, $height=null){
if(empty($dir)){
- return $dir;
+ return '/images/avatar-bg.png';
}
if($width=='original'){
diff --git a/common/models/User.php b/common/models/User.php
index 8217fd4..052010f 100755
--- a/common/models/User.php
+++ b/common/models/User.php
@@ -436,7 +436,19 @@
*/
public function getAddress()
{
- return $this->userInfo->country . ', ' . $this->userInfo->city . ', ' . $this->companyInfo->street . ', ' . $this->companyInfo->house;
+ $address = $this->userInfo->city;
+ if(!empty($this->userInfo->county)) {
+ $address = $this->userInfo->country.', '.$address;
+ }
+ if($this->type == 2) {
+ if(!empty($this->companyInfo->street)) {
+ $address .= ', '.$this->companyInfo->street;
+ }
+ if(!empty($this->companyInfo->house)) {
+ $address .= ', '.$this->companyInfo->house;
+ }
+ }
+ return $address;
}
/**
diff --git a/common/models/Vacancy.php b/common/models/Vacancy.php
index 60e6881..e1ee57f 100644
--- a/common/models/Vacancy.php
+++ b/common/models/Vacancy.php
@@ -236,4 +236,9 @@
$this->specializationInput = $value;
}
+ public function getUser()
+ {
+ return $this->hasOne(User::className(), ['id' => 'user_id']);
+ }
+
}
diff --git a/common/modules/comment/widgets/CommentWidget.php b/common/modules/comment/widgets/CommentWidget.php
index bd7b278..d1af137 100644
--- a/common/modules/comment/widgets/CommentWidget.php
+++ b/common/modules/comment/widgets/CommentWidget.php
@@ -278,6 +278,8 @@
if($this->comment_class->rating->load($data) && $this->comment_class->rating->save()) {
$this->isSuccess = true;
}
+ } else {
+ $this->isSuccess = true;
}
}
}
diff --git a/common/modules/comment/widgets/views/_project_comment_view.php b/common/modules/comment/widgets/views/_project_comment_view.php
index 81f2812..2ddc4ef 100644
--- a/common/modules/comment/widgets/views/_project_comment_view.php
+++ b/common/modules/comment/widgets/views/_project_comment_view.php
@@ -1,5 +1,6 @@
@@ -78,10 +85,13 @@
= $user->name ?>
-
-
-
-
+ 'rating_review_comment',
+ 'value' => $user->userInfo->rating,
+ 'pluginOptions' => ['displayOnly' => true, 'size' => 'xxs']
+ ]);
+ ?>
= Html::a(count($user->comments) . ' отзывов', $user->getLink('review'), [ 'class' => 'link-to-comm' ]) ?>
diff --git a/common/modules/comment/widgets/views/_review_comment_view.php b/common/modules/comment/widgets/views/_review_comment_view.php
index c7e9689..1fdd831 100644
--- a/common/modules/comment/widgets/views/_review_comment_view.php
+++ b/common/modules/comment/widgets/views/_review_comment_view.php
@@ -1,6 +1,7 @@
= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?>
rating )) {
- ?>
-
-
-
-
- 'rating_review_comment',
+ 'value' => $model->rating->value,
+ 'pluginOptions' => ['displayOnly' => true]
+ ]);
}
?>
isNewRecord) {
- $this->registerJs("$('div.rating').rating(
- {
- fx : 'full', readOnly : 'true', url : 'rating.php'
- }
- );");
- }
-?>
-
diff --git a/common/modules/comment/widgets/views/form-comment-review.php b/common/modules/comment/widgets/views/form-comment-review.php
index efd8760..28c0bbd 100644
--- a/common/modules/comment/widgets/views/form-comment-review.php
+++ b/common/modules/comment/widgets/views/form-comment-review.php
@@ -11,7 +11,6 @@
use yii\web\View;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
- $this->registerLinkTag(['rel' => 'stylesheet', 'href' => 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css']);
?>
hasRating()) {
- ?>
-
-
-
-
-
-
- 'rating_project_comment',
+ 'value' => $rating->value,
+ 'pluginOptions' => ['displayOnly' => true]
+ ]);
}
?>
diff --git a/frontend/controllers/SearchController.php b/frontend/controllers/SearchController.php
index 744e471..8a58e08 100755
--- a/frontend/controllers/SearchController.php
+++ b/frontend/controllers/SearchController.php
@@ -4,36 +4,19 @@ namespace frontend\controllers;
use common\models\Currency;
use common\models\CustomerSearch;
use common\models\Payment;
-use common\models\Project;
use common\models\Specialization;
use common\models\TenderSearch;
-use common\models\UserInfo;
-use common\models\Vacancy;
use frontend\models\SearchPerformerForm;
use frontend\models\SearchVacancyForm;
use Yii;
-use common\models\LoginForm;
-use frontend\models\PasswordResetRequestForm;
-use frontend\models\ResetPasswordForm;
-use frontend\models\SignupForm;
-use frontend\models\ContactForm;
use frontend\models\Options;
use frontend\models\OptionValues;
-use yii\base\InvalidParamException;
use yii\data\ActiveDataProvider;
use yii\data\Pagination;
-use yii\helpers\ArrayHelper;
-use yii\web\BadRequestHttpException;
use yii\web\Controller;
-use yii\filters\VerbFilter;
-use yii\filters\AccessControl;
use frontend\models\OptionsToValues;
-use yii\validators\EmailValidator;
-use common\models\User;
-use yii\helpers\VarDumper;
use common\models\Page;
use frontend\models\Option;
-use common\models\Social;
/**
* Site controller
@@ -110,8 +93,6 @@ use common\models\Social;
public function actionVacancy()
{
-
-
$searchModel = new SearchVacancyForm();
$specialization = Specialization::specializationsList();
diff --git a/frontend/messages/ru/app.php b/frontend/messages/ru/app.php
index 16f70e0..3a6a20c 100644
--- a/frontend/messages/ru/app.php
+++ b/frontend/messages/ru/app.php
@@ -169,5 +169,5 @@
'Project list' => 'Список заказов',
'Add project' => 'Добавить заказ',
'Main project' => 'Основной заказ',
-
+ 'Not found' => 'Ничего не найдено',
];
\ No newline at end of file
diff --git a/frontend/models/SearchVacancyForm.php b/frontend/models/SearchVacancyForm.php
index 28bd764..de074d3 100644
--- a/frontend/models/SearchVacancyForm.php
+++ b/frontend/models/SearchVacancyForm.php
@@ -18,8 +18,6 @@ class SearchVacancyForm extends Model
public $city;
public $specialization;
-
-
/**
* @inheritdoc
*/
@@ -56,12 +54,8 @@ class SearchVacancyForm extends Model
$query = Vacancy::find()
->distinct(true)
- ->joinWith(['specializations']);
-
-
-
-
-
+ ->joinWith(['specializations', 'user'])
+ ->andWhere(['user.type' => 2]);
if (!$this->validate()) {
@@ -76,10 +70,6 @@ class SearchVacancyForm extends Model
'specialization.specialization_id' => $this->specialization,
]);
-
-
-
-
return $query;
}
}
diff --git a/frontend/views/chat/message.php b/frontend/views/chat/message.php
index 984198d..0f52439 100755
--- a/frontend/views/chat/message.php
+++ b/frontend/views/chat/message.php
@@ -1,6 +1,7 @@
= $chat->interlocutor->userInfo->name ?>
-
-
-
-
+ 'rating_messange',
+ 'value' => $chat->interlocutor->userInfo->rating,
+ 'pluginOptions' => ['displayOnly' => true, 'size' => 'xxs']
+ ]);
+ ?>
= count($chat->interlocutor->comments) ?> отзывов
diff --git a/frontend/views/company/_company_common_review.php b/frontend/views/company/_company_common_review.php
index 96b63d3..4cabfda 100644
--- a/frontend/views/company/_company_common_review.php
+++ b/frontend/views/company/_company_common_review.php
@@ -3,18 +3,16 @@
* @var Comment $model
*/
use common\modules\comment\models\Comment;
+ use kartik\rating\StarRating;
?>
rating )) {
- ?>
-
-
-
-
-
-
- 'rating_company_review',
+ 'value' => $model->rating->value,
+ 'pluginOptions' => ['displayOnly' => true, 'size' => 'xxs']
+ ]);
}
?>