Commit 9b93120e86d290973eb83cd46e06b21bce0d0ee2
1 parent
e5b774cd
review fix
Showing
3 changed files
with
6 additions
and
1 deletions
Show diff stats
common/modules/comment/Controller.php
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | */ |
34 | 34 | $model->scenario = is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST; |
35 | 35 | if($model->deleteComment()) { |
36 | + $model->updateComment(); | |
36 | 37 | \Yii::$app->response->data = [ 'text' => 'Comment marked as deleted and will be check by administrators' ]; |
37 | 38 | } else { |
38 | 39 | \Yii::$app->response->data = [ 'error' => $model->hasErrors('comment_id') ? $model->getFirstError('comment_id') : 'Cannot delete message' ]; | ... | ... |
frontend/controllers/CompanyController.php
frontend/controllers/PerformerController.php
... | ... | @@ -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 | 59 | return parent::afterAction($action, $result); | ... | ... |