gongxiang4869
2018-10-27 08:10
采纳率: 87.5%
浏览 719
已采纳

thinkphp搜索内容分页问题

搜索完之后第一页正常显示 点击别的页码显示404 下面是部分代码 用的tp3.2框架

            if (empty($data['time'])){
            $fycount = $model
                ->field("t1.*,t2.phone,t2.id as userid,t2.name as username,t2.inviter,t3.name as productname,t3.rate,t3.id as productid")
                ->table("dk.dk_record as t1,dk.dk_user as t2,dk.dk_product as t3")
                ->where("t1.userid = t2.id and t1.productid = t3.id and ".$data['condition']." like '".$data['key']."'")
                ->count();
            $page = new \Think\Page($fycount,2);
            $page->rollPage = 5;
            $show = $page->show();
            $temp = $model
                ->field("t1.*,t2.phone,t2.id as userid,t2.name as username,t2.inviter,t3.name as productname,t3.rate,t3.id as productid")
                ->table("dk.dk_record as t1,dk.dk_user as t2,dk.dk_product as t3")
                ->where("t1.userid = t2.id and t1.productid = t3.id and ".$data['condition']." like '".$data['key']."'")
                ->limit($page->firstRow,$page->listRows)
                ->select();
        }

                    搜索条件是$data里的内容
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • gongxiang4869 2018-10-27 08:25
    已采纳

    是post数据的问题 用get

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题