From 9f58b40cbd55e3de63778e32e252f8c45ca72e71 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 27 Oct 2017 14:52:20 +0300 Subject: [PATCH] -Blog category fixed --- frontend/controllers/BlogController.php | 7 ++++--- frontend/views/blog/_article.php | 20 ++++++++++---------- frontend/widgets/BlogSidebar.php | 1 + 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/controllers/BlogController.php b/frontend/controllers/BlogController.php index 2f2088b..76fbee6 100755 --- a/frontend/controllers/BlogController.php +++ b/frontend/controllers/BlogController.php @@ -22,7 +22,7 @@ ->with('lang.alias') ->with('image') ->with('tags.lang.alias') - ->with('category.lang.alias') + ->with('categories.lang.alias') ->where([ 'status' => true ]); $dataProvider = new ActiveDataProvider( @@ -54,10 +54,11 @@ ->with('image') ->with('tags.lang.alias') ->innerJoinWith('category') - ->with('category.lang.alias') + ->with('categories.lang.alias') ->where([ 'blog_category_id' => $id ]); $category = Category::find() + ->where([ 'id' => $id ]) ->with('lang') ->one(); @@ -99,7 +100,7 @@ $query = Article::find() ->with('lang.alias') ->with('image') - ->with('category.lang.alias') + ->with('categories.lang.alias') ->innerJoinWith('tags.lang.alias') ->where([ 'blog_tag_id' => $id ]) ->where([ 'blog_article.status' => true ]); diff --git a/frontend/views/blog/_article.php b/frontend/views/blog/_article.php index 6d2a097..0f3302f 100755 --- a/frontend/views/blog/_article.php +++ b/frontend/views/blog/_article.php @@ -18,19 +18,19 @@ ) ?>">lang->title ?>
- category)) { ?> + categories as $category) { ?>

category->lang->title ?> + ) ?>">lang->title ?>

tags)) { ?> -