|  | 
 
| PHP复制代码 复制代码public function get_list_all($id){ //ID为分类的ID
                        $search  =  post('search');  //取按钮值
                        $title   =  post('title');
                        $leixing =  post('leixing');
                        $tuijian =  post('tuijian');
                        
                        $where = array('`c_small`'=>$id);  //初始化条件,如果没有搜索的话默认去当前分类下的总数
                        if(!empty($search)){//当按下搜索时,根据条件组合搜索条件
                                if(!empty($title)){$where = array_merge($where,array('`c_title` like'=>"%".$title."%"));}
                                if($leixing != "nothing"){$where = array_merge($where,array('`c_leixing`'=>$leixing));}
                                if($tuijian != "nothing"){$where = array_merge($where,array('`c_tuijian`'=>$tuijian));}
                        }
                        $this->db->where($where);
                        $this->db->from('`my_content`');
                        return $this->db->count_all_results();
                }
 很菜,不要骂,呵呵
 | 
 |