1
即时通讯工作在codeigniter的论坛上,我想显示一个类别中有多少个Threds,但是我的问题是它只显示已经发布的分类。codeigniter显示一个类别中有多少个线程
我想显示所有的类别,虽然里面没有帖子。我怎么能这样做?
这里是我的模型文件
//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();
}