Commit 20a22bc7e04819670274f07ae9795d85bee3a7bd
1 parent
63afc060
test
Showing
4 changed files
with
4 additions
and
25 deletions
Show diff stats
frontend/controllers/PerformerController.php
| @@ -145,7 +145,7 @@ class PerformerController extends Controller | @@ -145,7 +145,7 @@ class PerformerController extends Controller | ||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | 147 | ||
| 148 | - $query = Blog::find(['user_id'=>$performer_id]); | 148 | + $query = $user->getBlog(); |
| 149 | 149 | ||
| 150 | $countQuery = clone $query; | 150 | $countQuery = clone $query; |
| 151 | 151 | ||
| @@ -179,8 +179,7 @@ class PerformerController extends Controller | @@ -179,8 +179,7 @@ class PerformerController extends Controller | ||
| 179 | 179 | ||
| 180 | 180 | ||
| 181 | $article = Blog::findOne(['link'=>$link,'user_id'=>$performer_id]); | 181 | $article = Blog::findOne(['link'=>$link,'user_id'=>$performer_id]); |
| 182 | - $article->view_count ++; | ||
| 183 | - $article->save(); | 182 | + $article->updateCounters(['view_count' => 1]); |
| 184 | 183 | ||
| 185 | 184 | ||
| 186 | return $this->render('blog-view',[ | 185 | return $this->render('blog-view',[ |
frontend/views/accounts/_portfolio_form.php
| @@ -89,24 +89,6 @@ use yii\web\JsExpression; | @@ -89,24 +89,6 @@ use yii\web\JsExpression; | ||
| 89 | <div class="not-file-mb-adm">До 3 Мб файл</div> | 89 | <div class="not-file-mb-adm">До 3 Мб файл</div> |
| 90 | </div> | 90 | </div> |
| 91 | 91 | ||
| 92 | - <div class="input-blocks-wrapper admin-avatar portfolio-foto-admin hidden-foto foto-portfolio-adm"> | ||
| 93 | - <div class="gen-admin-title">Фото главное</div> | ||
| 94 | - <div class="not-file-txt-adm">Файл не выбран</div> | ||
| 95 | - <?= ImageUploader::widget([ | ||
| 96 | - 'model'=> $portfolio, | ||
| 97 | - 'field'=>'cover', | ||
| 98 | - 'width'=>100, | ||
| 99 | - 'height'=>100, | ||
| 100 | - 'multi'=>false, | ||
| 101 | - 'gallery' =>$portfolio->cover, | ||
| 102 | - 'name' => 'Загрузить' | ||
| 103 | - ]); | ||
| 104 | - ?> | ||
| 105 | - <div class="not-file-mb-adm">До 3 Мб файл</div> | ||
| 106 | - </div> | ||
| 107 | - | ||
| 108 | - | ||
| 109 | - | ||
| 110 | <div class="input-blocks-wrapper"> | 92 | <div class="input-blocks-wrapper"> |
| 111 | <div class="input-blocks"> | 93 | <div class="input-blocks"> |
| 112 | <?= | 94 | <?= |
frontend/views/performer/_blog_list_view.php
| @@ -16,12 +16,12 @@ use yii\helpers\Url; | @@ -16,12 +16,12 @@ use yii\helpers\Url; | ||
| 16 | <span></span><p><?= $model->view_count?></p> | 16 | <span></span><p><?= $model->view_count?></p> |
| 17 | </div> | 17 | </div> |
| 18 | <div class="blog-post-comm-num"> | 18 | <div class="blog-post-comm-num"> |
| 19 | - <span></span><p><?= $model->view_count?></p> | 19 | + <span></span><p>XX</p> |
| 20 | </div> | 20 | </div> |
| 21 | </div> | 21 | </div> |
| 22 | <div class="blog-post-content style"> | 22 | <div class="blog-post-content style"> |
| 23 | <?= Html::a(Html::img($model->cover), Url::toRoute(['/performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]));?> | 23 | <?= Html::a(Html::img($model->cover), Url::toRoute(['/performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]));?> |
| 24 | - <?= StringHelper::truncate($model->description, 1500)?> | 24 | + <?= StringHelper::truncate($model->description, 1500, '...', null, true)?> |
| 25 | </div> | 25 | </div> |
| 26 | <?= Html::a('<span>Подробнее</span>', Url::toRoute(['performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]),['class'=>'blog-post-see-all style']);?> | 26 | <?= Html::a('<span>Подробнее</span>', Url::toRoute(['performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]),['class'=>'blog-post-see-all style']);?> |
| 27 | </div> | 27 | </div> |
| 28 | \ No newline at end of file | 28 | \ No newline at end of file |
frontend/views/performer/portfolio_list_view.php
| @@ -2,8 +2,6 @@ | @@ -2,8 +2,6 @@ | ||
| 2 | use yii\helpers\ArrayHelper; | 2 | use yii\helpers\ArrayHelper; |
| 3 | use yii\helpers\Html; | 3 | use yii\helpers\Html; |
| 4 | use yii\helpers\StringHelper; | 4 | use yii\helpers\StringHelper; |
| 5 | - | ||
| 6 | - | ||
| 7 | ?> | 5 | ?> |
| 8 | <div class="portfolio-project-blocks-wr"> | 6 | <div class="portfolio-project-blocks-wr"> |
| 9 | <div class="portfolio-project-blocks-img-title"> | 7 | <div class="portfolio-project-blocks-img-title"> |