码迷,mamicode.com
首页 > Web开发 > 详细

thinkphp带查询条件的分页

时间:2015-10-26 20:23:29      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<style type=‘text/css‘>
.meneame a{
    background: #3083EB;
    text-align: center;
    color: #fff;
    padding: 4px 10px;
    display: inline;
    cursor: pointer;
}
.meneame{text-align: right;}
.meneame .current {
    background: url("0");
    width: auto;
    display: inline;
    padding: 4px 10px;
    border: 0;
}
</style>
<body>
    <div class="meneame">{$page}</div>
</body>
</html>

<?php
$search_factory_infos=trim($this->_request(‘search_factory_infos‘));
$where[‘account‘]=array(‘like‘,"%$search_factory_infos%");
import(‘ORG.Util.Page‘);// 导入分页类
$Page = new Page($count,10);// 实例化分页类 传入总记录数和每页显示的记录数
//分页跳转的时候保证查询条件
foreach($where as $key=>$val){
    if(!is_array($val)){
        $Page->parameter .="$key=".urlencode($val)."&";//赋值给Page
    }
}
$show  = $Page->show();// 分页显示输出
$list=M(‘user_set_facorder‘)->where($where)->limit($Page->firstRow . ‘,‘ . $Page->listRows)->select();
?>

 

thinkphp带查询条件的分页

标签:

原文地址:http://www.cnblogs.com/719907411hl/p/4912084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!