Skip to content

Commit b37d92f

Browse files
committed
Merge branch 'bugfix-publish' into develop
2 parents f8ca785 + 93259d3 commit b37d92f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Controllers/BinshopsReaderController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public function index($locale, $category_slug = null, Request $request)
6363
\View::share('binshopsblog_category', $category); // so the view can say "You are viewing $CATEGORYNAME category posts"
6464
$title = 'Posts in ' . $category->category_name . " category"; // hardcode title here...
6565
} else {
66-
$posts = BinshopsPostTranslation::where('lang_id', $request->get("lang_id"))
67-
->with(['post' => function($query){
68-
$query->where("is_published" , '=' , true);
69-
$query->where('posted_at', '<', Carbon::now()->format('Y-m-d H:i:s'));
70-
$query->orderBy("posted_at", "desc");
71-
}])->paginate(config("binshopsblog.per_page", 10));
66+
$posts = BinshopsPostTranslation::join('binshops_posts', 'binshops_post_translations.post_id', '=', 'binshops_posts.id')
67+
->where('lang_id', $request->get("lang_id"))
68+
->where("is_published" , '=' , true)
69+
->where('posted_at', '<', Carbon::now()->format('Y-m-d H:i:s'))
70+
->orderBy("posted_at", "desc")
71+
->paginate(config("binshopsblog.per_page", 10));
7272
}
7373

7474
//load category hierarchy

0 commit comments

Comments
 (0)