This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
omdreamreg6295
I use database prefix "oct_"
protected function loadCategories()
{
$categories = BlogCategory::orderBy('name');
if (!$this->property('displayEmpty')) {
$categories->whereExists(function($query) {
$query->select(Db::raw(1))
->from('rainlab_blog_posts_categories')
->join('rainlab_blog_posts', 'rainlab_blog_posts.id', '=', 'rainlab_blog_posts_categories.post_id')
->whereNotNull('rainlab_blog_posts.published')
->where('rainlab_blog_posts.published', '=', 1)
->whereRaw('rainlab_blog_categories.id = rainlab_blog_posts_categories.category_id');
});
}
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'rainlab_blog_categories.id' in 'where clause' (SQL: select * from `oct_rainlab_blog_categories` where exists (select 1 from `oct_rainlab_blog_posts_categories` inner join `oct_rainlab_blog_posts` on `oct_rainlab_blog_posts`.`id` = `oct_rainlab_blog_posts_categories`.`post_id` where `oct_rainlab_blog_posts`.`published` is not null and `oct_rainlab_blog_posts`.`published` = 1 and rainlab_blog_categories.id = rainlab_blog_posts_categories.category_id) order by `nest_left` asc, `name` asc)
Last updated
1-3 of 3