diff --git a/common/modules/comment/models/Comment.php b/common/modules/comment/models/Comment.php index 7275825..28d847e 100644 --- a/common/modules/comment/models/Comment.php +++ b/common/modules/comment/models/Comment.php @@ -173,7 +173,7 @@ 'comment.model' => $model, 'comment.model_id' => $model_id, 'comment.status' => 1, - ]); + ])->with('rating'); } public function postComment() @@ -310,7 +310,7 @@ 'model' => $this->className(), ]) ->one(); - if(!$rating instanceof \common\modules\comment\models\Rating) { + if(!$rating instanceof \common\modules\comment\models\Rating && !$this->isNewRecord) { $rating = new \common\modules\comment\models\Rating([ 'model' => $this->className(), 'model_id' => $this->comment_id, diff --git a/frontend/views/layouts/company.php b/frontend/views/layouts/company.php index 5deeee9..45d930c 100755 --- a/frontend/views/layouts/company.php +++ b/frontend/views/layouts/company.php @@ -1,20 +1,24 @@ beginContent('@app/views/layouts/main.php'); + $this->beginContent('@app/views/layouts/main.php'); ?>