import('ORG.Util.Page'); // 导入分页类
$map['type'] = $_POST['type'];
$map['variety'] = $_POST['variety'];
$count = $standard->where($map)->count();
$Page = new Page($count, 20); // 实例化分页类 传入总记录数和每页显示的记录数
//分页跳转的时候保证查询条件
foreach ($map as $key => $val) {
if (!is_array($val)) {
$Page->parameter .= "$key =" . urlencode($val) . "&"; //传入参数值
}
}
$show = $Page->show(); // 分页显示输出
$arr = $standard->where($map)->limit($Page->firstRow . ',' . $Page->listRows)->order('week')->select();
补充:SELECT * FROM `ch_standard` WHERE ( `type` = null ) AND ( `variety` = null ) ORDER BY week LIMIT 20,20 [ RunTime:0.000177s ]
传来的数据为空。
最佳答案