1切是如斯旳不 发表于 2013-9-29 12:56:35

我在模型里面传入了总记录数和下一页记录数,控制器怎么写

       
        //选择
        public function select($typename=0,$id = 0,$shopid = 0,$cateid = 0,$page = 0,$page_count = 20){
                if($id>0){
                        $this->db->where("id",$id);
                }
                if($shopid>0){
                        $this->db->where("shopid",$shopid);
                }
                if($cateid>0){
                        $this->db->where("cateid",$cateid);
                }
                if($typename){
                        $this->db->where("typename",$typename);
                }
                if($page>0){
                        $this->db->limit($page*$page_count,($page-1)* $page_count);
                }
                $query = $this->db->get('activity');
                return $query->result();

qq907274532 发表于 2013-9-30 11:33:41

什么意思,自己写的分页类还是啥

1切是如斯旳不 发表于 2013-10-9 13:07:44

不好意思,才看到...用的CI类库,已经解决了...传参错误..
页: [1]
查看完整版本: 我在模型里面传入了总记录数和下一页记录数,控制器怎么写