带中文搜索以后第二页开始就查询不出来数据

浏览:1237 发布日期:2015/09/18 分类:求助交流
搜索表单代码:    <form action="__URL__/index" method="get" id="searchfrm">
       <li><label>日期范围</label>
          <input id="shijian1" name="shijian1" type="text" class="scinput" style="width:120px;" onclick="WdatePicker()">
          -
          <input id="shijian2" name="shijian2" type="text" class="scinput" style="width:120px;" onclick="WdatePicker()">
        </li>
        <li><label>关键词</label><input id="guanjianci" name="guanjianci" type="text" class="scinput" style="width:180px"></li>
        <li><label>摘要</label><input id="zhaiyao" name="zhaiyao" type="text" class="scinput" style="width:180px"></li>
        <li><div style="padding-top:10px;"><input type="radio" name="duihua" id="duihua" value="1"> 有对话</div></li>
        <li><button type="submit" class="scbtn" id="searchbn" name="searchbn">查询</button></li>
        </form>
搜索处理方法代码:class TourfangwenController extends Controller {
    public function index(){
        //判断登录
        if(cookie('username')){            
        }else{
            $this->error('请先登录!', '/index.php/Home/Index/login');
        }
        
        if ($_GET['shijian1']<>'' and $_GET['shijian2']<>''){
            $map['shijian'] = array('between',array(strtotime($_GET['shijian1']." 00:00:00"),strtotime($_GET['shijian2']." 23:59:59"))); // 获取查询参数:访问时间
        }
        if ($_GET['guanjianci']<>''){
            $map['guanjianci'] = array('like',"%".$_GET['guanjianci']."%"); // 获取查询参数:关键词
        }
        if ($_GET['zhaiyao']<>''){
            $map['zhaiyao'] = array('like',"%".$_GET['zhaiyao']."%"); // 获取查询参数:摘要
        }
        if ($_GET['duihua']<>''){
            $map['duihua'] = 1; // 获取查询参数:对话
        }
        $Data = M('tourfangwen'); // 实例化Data对象
        $count = $Data->where($map)->count();// 查询满足要求的总记录数
        $Page = new \Think\Page($count,10);// 实例化分页类 传入总记录数和每页显示的记录数(10)        
        $page = $Page->show();// 分页显示输出
        // 进行分页数据查询 注意limit方法的参数要使用Page类的属性
        $data = $Data->where($map)->order('shijian desc,id desc')->limit($Page->firstRow.','.$Page->listRows)->select();
        $this->assign('data',$data);// 赋值数据集
        $this->assign('page',$page);// 赋值分页输出
        $this->assign('count',$count);// 赋值记录数
        $this->display(); // 输出模板
    }
搜索结果显示页面代码:    <table class="tablelist">
        <thead>
        <tr>
        <th><input name="checkall" type="checkbox" id="checkall" onclick="selectAll()" /></th>
        <th>ID</th>
        <th>时间</th>
        <th>地区</th>
        <th>关键词</th>
        <th>是否对话</th>
        <th>摘要</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="data" item="vo">
        <tr>
        <td><input type="checkbox" value="{$vo.id}" name="id"></td>
        <td>{$vo.id}</td>
        <td>{$vo.shijian|date='Y-m-d H:i:s',###}</td>
        <td>{$vo.diqu}</td>
        <td>{$vo.guanjianci}</td>
        <td><eq name='vo.duihua' value="1">有<else />无</eq></td>
        <td>{$vo.zhaiyao}</td>
        <td><a href="__URL__/update/id/{$vo.id}">编辑</a> <a href="javascript:if(confirm('确实要删除吗?'))location.href='__URL__/del/id/{$vo.id}';">删除</a></td>
        </tr>
        </foreach>     
        </tbody>
    </table>
    
    <div class="page_01"><span>共{$count}个</span>{$page}</div>
关键词和摘要项输入字母或数字查询时没有问题,输入中文查询时第一页正常,第二页开始就查不到数据了,高手帮看看是什么问题
最佳答案
评论( 相关
后面还有条评论,点击查看>>