ecshop 分页


$pager = get_pager('test.php', $act, $record_count, $page, $page_size);
$smarty->assign('pager',        $pager);

//  test.php代表:当前PHP文件
// $act 是路径参数 例如:
//      $act=array('canshu'=>1,'canshu2'=>2);
//      代表 ?canshu=1&canshu2=2
// $record_count代表数据条数
// $page 当前页面
// $page_size 每页显示条数



if($page>ceil($record_count/$page_size)){
    $page=ceil($record_count/$page_size);
}elseif($page<=1){
    $page=1;
}

$sql    =    'select * from '.$ecs->table('huiben').' where is_on=1 and huiben_number>0 order by id asc  limit '.($page-1)*$page_size.','.$page_size;
$huiben_list    =    $db->getAll($sql);



$smarty->assign('huiben_list',$huiben_list);
原文地址:https://www.cnblogs.com/lixingbaophp/p/4759621.html