thinkphp5的分页paginator的实现

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Dangdangcyuyan/article/details/78888993

use think\Paginator;   //paginator类的引入

$where = array();

 $getInfo = input("get.");
 $getParam = ['query' => []];   //paginator的数据传到页面数组类型定义
        if (input("get.")) {   //分页查询条件查询的接收
            $getParam["query"][""] = input("get.");
            $where[""] = input("get.");
        }
        if (input("post.")) {//首次条件查询的数据接收
            $getCheckInfo = input("post.");
            $where[""] = $getCheckInfo;
            $getParam["query"][""] = $getCheckInfo;
        }
        $res = Db::table("")->where($where)->order("")->paginate(13, false, $getParam);
        $this->assign("InfoList", $res);

        return $this->fetch();

//实现效果  bookstrap引入

猜你喜欢

转载自blog.csdn.net/Dangdangcyuyan/article/details/78888993