|
|
libs / classes / model.class.php
新增
public function multi_listinfo($where = '', $page = 1, $pagesize = 20, $key='', $setpages = 10,$urlrule = '',$array = array()) {
//$sql = preg_replace('/select([^from].*)from/i', "SELECT COUNT(*) as count FROM ", $where);
// $this->query($sql);
// $c = $this->db->fetch_next(); //$this->number = $c['count'];
$this->query($where);
$c = $this->count();
$this->number = $c;
$page = max(intval($page), 1);
$offset = $pagesize*($page-1);
$this->pages = pages($this->number, $page, $pagesize, $urlrule, $array, $setpages);
$r = $this->query($where.' LIMIT '.$offset.','.$pagesize);
while(($s = $this->db->fetch_next()) != false){
$data[] = $s;
}
return $data;
}
|
|