我在codeigniter的一个论坛上工作,我想显示一个类别中有多少个Thred,但我的问题是它只显示已经发布的类别。
我想显示所有类别,尽管其中没有帖子。我怎样才能做到这一点 ?。
这是我的模型文件
//Load the category list to the forum frontpage
function loadCategoryList() {
$this->db->select('forumCategory.id as categoryID, category, description, COUNT(forumThread.id) as threadID');
$this->db->where('forumCategory.approved', 'yes');
$this->db->join('forumThread', 'forumThread.fk_forumCategory = forumCategory.id');
$this->db->group_by('categoryID');
$loadCategory = $this->db->get('forumCategory');
return $loadCategory->result();
}