用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1922|回复: 2
收起左侧

[讨论/交流] 我在模型里面传入了总记录数和下一页记录数,控制器怎么写

[复制链接]
发表于 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();

发表于 2013-9-30 11:33:41 | 显示全部楼层
什么意思,自己写的分页类还是啥
 楼主| 发表于 2013-10-9 13:07:44 | 显示全部楼层
不好意思,才看到...用的CI类库,已经解决了...传参错误..

本版积分规则