Commit 9b93120e86d290973eb83cd46e06b21bce0d0ee2

Authored by Alex Savenko
1 parent e5b774cd

review fix

common/modules/comment/Controller.php
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
33 */ 33 */
34 $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; 34 $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST;
35 if($model->deleteComment()) { 35 if($model->deleteComment()) {
  36 + $model->updateComment();
36 \Yii::$app->response->data = [ 'text' => 'Comment marked as deleted and will be check by administrators' ]; 37 \Yii::$app->response->data = [ 'text' => 'Comment marked as deleted and will be check by administrators' ];
37 } else { 38 } else {
38 \Yii::$app->response->data = [ 'error' => $model->hasErrors('comment_id') ? $model->getFirstError('comment_id') : 'Cannot delete message' ]; 39 \Yii::$app->response->data = [ 'error' => $model->hasErrors('comment_id') ? $model->getFirstError('comment_id') : 'Cannot delete message' ];
frontend/controllers/CompanyController.php
@@ -56,6 +56,7 @@ @@ -56,6 +56,7 @@
56 if($user->id != \Yii::$app->user->id) { 56 if($user->id != \Yii::$app->user->id) {
57 $user->userInfo->updateCounters([ 'view_count' => 1 ]); 57 $user->userInfo->updateCounters([ 'view_count' => 1 ]);
58 } 58 }
  59 + $user->updateRating();
59 } 60 }
60 } 61 }
61 return $result; 62 return $result;
frontend/controllers/PerformerController.php
@@ -50,7 +50,10 @@ @@ -50,7 +50,10 @@
50 } 50 }
51 } 51 }
52 } 52 }
53 - $user->userInfo->updateCounters([ 'view_count' => 1 ]); 53 + if($user->id != \Yii::$app->user->id) {
  54 + $user->userInfo->updateCounters([ 'view_count' => 1 ]);
  55 + }
  56 + $user->updateRating();
54 } 57 }
55 } 58 }
56 return parent::afterAction($action, $result); 59 return parent::afterAction($action, $result);