<?php
class ctl_package extends shopPage{
var $customer_template_type='package';
function index($page=1) {
$objPackage = &$this->system->loadModel('trading/package');
$aData = $objPackage->getPackageList($page-1);
$aData = $aData + $objPackage->getPackageList($page); $this->pagedata['package'] = $aData['data'];
$sitemapts=&$this->system->loadModel('content/sitemap');
$title=$sitemapts->getTitleByAction('package:index');
$title=$title['title']?$title['title']:__('鎹嗙粦淇冮攢'); $this->path[]=array('title'=>$title);
$this->title = $title;
$this->pagedata['package'] = $aData['data']; if($this->system->getConf('site.show__price')){
$setting['mktprice'] = $this->system->getConf('site.et_price');
}else{
$setting['mktprice'] = 0;
}
$setting['saveprice'] = $this->system->getConf('site.save_price');
$setting['buytarget'] = $this->system->getConf('site.buy.target');
$this->pagedata['setting'] = $setting;
$this->pagedata['pager'] = array(
'current'=> $page,
'total'=> $aData['page'],
'link'=> $this->system->mkUrl('package','index', array($tmp = time())),
'token'=> $tmp); $this->output();
}
}
?>
这段代码是否可以将多页合并到这个方法里实现,不要分页像蓝色字体那样,怎么实现?谢谢!
class ctl_package extends shopPage{
var $customer_template_type='package';
function index($page=1) {
$objPackage = &$this->system->loadModel('trading/package');
$aData = $objPackage->getPackageList($page-1);
$aData = $aData + $objPackage->getPackageList($page); $this->pagedata['package'] = $aData['data'];
$sitemapts=&$this->system->loadModel('content/sitemap');
$title=$sitemapts->getTitleByAction('package:index');
$title=$title['title']?$title['title']:__('鎹嗙粦淇冮攢'); $this->path[]=array('title'=>$title);
$this->title = $title;
$this->pagedata['package'] = $aData['data']; if($this->system->getConf('site.show__price')){
$setting['mktprice'] = $this->system->getConf('site.et_price');
}else{
$setting['mktprice'] = 0;
}
$setting['saveprice'] = $this->system->getConf('site.save_price');
$setting['buytarget'] = $this->system->getConf('site.buy.target');
$this->pagedata['setting'] = $setting;
$this->pagedata['pager'] = array(
'current'=> $page,
'total'=> $aData['page'],
'link'=> $this->system->mkUrl('package','index', array($tmp = time())),
'token'=> $tmp); $this->output();
}
}
?>
这段代码是否可以将多页合并到这个方法里实现,不要分页像蓝色字体那样,怎么实现?谢谢!
'total'=> $aData['page'],
getPackageList函数中进行代码出来,让他返回整个数据,然后这里就不用分页了。就设置为1也不就行了