Codeigniter类别菜单

时间:2015-02-05 11:28:20

标签: codeigniter codeigniter-2 codeigniter-url

公共职能类别(){

//Get Article View
$data['articles'] = $this->Article_model->get_categories_t('id','DESC');
//Get Articles

//Load View

$this->load->view('cate', $data);

} 和我的模特

public function get_categories($order_by = null, $sort = 'DESC', $limit = null, $offset = 0) {
$this->db->select('a.*, c.name as category_name');
$this->db->from('articles as a');
$this->db->join('categories AS c', 'a.category_id = c.id ','LEFT');
if($limit != null) {
    $this->db->limit($limit, $offset);
}
if($order_by != null) {
    $this->db->order_by($order_by, $sort);
}
$query = $this->db->get();
return $query->result();}

我的问题是查看数据是所有不属于选定类别的文章

我不明白我做错了所以请帮忙

0 个答案:

没有答案