...
|
...
|
@@ -11,7 +11,7 @@ class Controller_Default extends Controller_Abstract |
|
|
public function indexAction()
|
|
|
{
|
|
|
$total = Facade_News::getTotal(array(), array('手机视频'));
|
|
|
$page = new Lib_Helper_Pagination($total, 24);
|
|
|
$page = new Lib_Helper_Pagination($total, 72);
|
|
|
$page->setOptions(array('afterAppend' => 'setLayout'));
|
|
|
list($offset, $limit) = $page->getLimit();
|
|
|
$this->_view['banners'] = Facade_Index::getIndex(1);
|
...
|
...
|
@@ -25,7 +25,8 @@ class Controller_Default extends Controller_Abstract |
|
|
$this->_view['partnerTypes'] = Facade_Partner::$types;
|
|
|
$this->_view['pagination'] = $page->getPagination();
|
|
|
$this->_view['rightBanners'] = $rightBanners;
|
|
|
$this->_view['news'] = $list;
|
|
|
$data=array_slice($list,0,24);
|
|
|
$this->_view['news'] = $data;
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -85,4 +86,29 @@ class Controller_Default extends Controller_Abstract |
|
|
$this->_view['image'] = $dir.$val.'.jpg';
|
|
|
$this->_viewname = 'wallpaperimagemobile';
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 首页加载资讯ajax接口
|
|
|
*
|
|
|
*/
|
|
|
public function LoadNewsAction()
|
|
|
{
|
|
|
$total = Facade_News::getTotal(array(), array('手机视频'));
|
|
|
$page = new Lib_Helper_Pagination($total, 72);
|
|
|
$page->setOptions(array('afterAppend' => 'setLayout'));
|
|
|
list($offset, $limit) = $page->getLimit();
|
|
|
$list = Facade_News::getList(array(), $offset, $limit, array('手机视频'));
|
|
|
$type = $this->_request->query('type', null);
|
|
|
if($type==1){
|
|
|
$data=array_slice($list,0,24);
|
|
|
};
|
|
|
if($type==2){
|
|
|
$data=array_slice($list,24,24);
|
|
|
}
|
|
|
if($type==3){
|
|
|
$data=array_slice($list,48,24);
|
|
|
}
|
|
|
return json_encode($data);
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|