搜索
系统检测到您的用户名不符合规范:

thinkphp分页条件丢失

浏览:849 发布日期:2016年11月23日 分类:求助交流 关键字: thinkphp 分页 丢失

大神们,我GET传过来的条件在分页第二页的时候会丢失,怎样保存住 呢?public function cw_drawRecord(){
$userId = session('user')['member_id'];
$userName = session('username');
if($_GET){

if($_GET['time']=="all"){
$start_time = 0;
$end_time = time();
}
if($_GET['time']=="week"){
$start_time = strtotime(date("Y-m-d", strtotime("-1 week")));
$end_time = time();
}
if($_GET['time']=="month"){
$start_time = strtotime(date("Y-m-d", strtotime("-1 month")));
$end_time = time();
}
if($_GET['time']=="year"){
$start_time = strtotime(date("Y-m-d", strtotime("-1 year")));
$end_time = time();
}
if($_GET['id']=="record"){
$start_time = strtotime(date("Y-m-d", strtotime(0)));
$end_time = time();
}
if($_GET['time']=="Period"){
$start_time = strtotime($_GET['start']);
$end_time = strtotime($_GET['end']);
}

}else{
$end_time = time();
$start_time = 0;
}
$condition['withdraw_time'] = array(between,array($start_time,$end_time));
$condition['member_id'] = $userId;
$bill_withdraw = M('bill_withdraw');
$count = $bill_withdraw->where($condition)->count();// 查询满足要求的总记录数

$Page = new \Think\Page($count,6);// 实例化分页类 传入总记录数和每页显示的记录数
$show = $Page->show();// 分页显示输出
$list =$bill_withdraw->where($condition)->field('withdraw_sn,withdraw_time,withdraw_money,withdraw_bank_num,withdraw_bank_name,withdraw_status,withdraw_mark')->limit($Page->firstRow. ',' . $Page->listRows)->order('withdraw_time desc')->select();
echo M()->_sql();
foreach($list as $key=>$value){
$new_list[$key]['withdraw_sn'] = $value['withdraw_sn'];
$new_list[$key]['withdraw_time'] = $value['withdraw_time'];
$new_list[$key]['withdraw_money'] = $value['withdraw_money'];
$new_list[$key]['withdraw_bank_num'] = substr($value['withdraw_bank_num'],-4,4);
$new_list[$key]['withdraw_bank_name'] = $value['withdraw_bank_name'];
$new_list[$key]['withdraw_status'] = $value['withdraw_status'];
$new_list[$key]['withdraw_mark'] = $value['withdraw_mark'];
}
$this->assign('list',$new_list);
$this->assign('page',$show);// 赋值分页输出
$this->assign('userName',$userName);
layout("Layout/main");
$this->display();
}
最佳答案
评论() 相关
后面还有条评论,
评论支持使用[code][/code]标签添加代码
您需要登录后才可以评论 登录 | 立即注册
收藏
Yeuηg
积分:960 等级:LV2
热点推荐
(追記) (追記ここまで)
最新更新

我们

合作

网站

信息

ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。

AltStyle によって変換されたページ (->オリジナル) /