|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Guang\ListData;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
|
|
* 逛首页、列表页、编辑页
|
...
|
...
|
@@ -8,351 +11,113 @@ class ListController extends AbstractAction |
|
|
{
|
|
|
/**
|
|
|
* 首页
|
|
|
*
|
|
|
* @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士
|
|
|
* @param string gender '1,3'表示男,'2,3'表示女
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'swiper' => array(
|
|
|
array(
|
|
|
'url' => '',
|
|
|
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/07/06/10/014fd517e2fe3f3e0dc3cbc3007d8093af.jpg?imageView/2/w/640/h/640'
|
|
|
),
|
|
|
array(
|
|
|
'url' => '',
|
|
|
'img' => 'http://img10.static.yhbimg.com/yhb-img01/2015/07/03/13/01a165dd33db8488edc741241950a596a8.jpg?imageView/2/w/640/h/640'
|
|
|
)
|
|
|
),
|
|
|
'navs' => array(
|
|
|
array(
|
|
|
'typeId' => 1,
|
|
|
'type' => '最新'
|
|
|
),
|
|
|
array(
|
|
|
'typeId' => 2,
|
|
|
'type' => '话题',
|
|
|
'focus' => true
|
|
|
),
|
|
|
array(
|
|
|
'typeId' => 3,
|
|
|
'type' => '搭配'
|
|
|
),
|
|
|
array(
|
|
|
'typeId' => 4,
|
|
|
'type' => '潮人'
|
|
|
),
|
|
|
array(
|
|
|
'typeId' => 5,
|
|
|
'type' => '潮物'
|
|
|
),
|
|
|
array(
|
|
|
'typeId' => 6,
|
|
|
'type' => '小贴士'
|
|
|
)
|
|
|
),
|
|
|
'infos' => array(
|
|
|
array(
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionMan' => true,
|
|
|
'author' => array(
|
|
|
'url' => '',
|
|
|
'name' => 'LEO_LU',
|
|
|
'avatar' => 'http://img11.static.yhbimg.com/yhb-img02/2015/09/07/02/01a050445c64825eed381c4e049030c692.jpg?imageView/0/w/100/h/100'
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'collect' => array(
|
|
|
'isCollected' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true,
|
|
|
'author' => array(
|
|
|
'url' => '',
|
|
|
'name' => 'Kishi',
|
|
|
'avatar' => 'http://img13.static.yhbimg.com/yhb-img02/2015/06/12/10/0256020c504fb08a176c5457599bdf5b49.jpg?imageView/0/w/100/h/100'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'show' => true,
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'info' => array(
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('index', array('guangHome' => true, 'guang' => $data));
|
|
|
$this->setTitle('逛');
|
|
|
|
|
|
$category = ListData::category();
|
|
|
$articleGroup = array();
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$type = $this->get('type', 0);
|
|
|
$gender = $this->get('gender');
|
|
|
|
|
|
// 男
|
|
|
if ($gender === '1,3') {
|
|
|
$articleGroup = ListData::articleGroup($category['data'], '1,3', $uid, $udid);
|
|
|
}
|
|
|
// 女
|
|
|
elseif ($gender === '2,3') {
|
|
|
$articleGroup = ListData::articleGroup($category['data'], '2,3', $uid, $udid);
|
|
|
}
|
|
|
// 所有
|
|
|
else {
|
|
|
$articleGroup = ListData::articleGroup($category['data'], '1,2,3', $uid, $udid);
|
|
|
}
|
|
|
|
|
|
$data = array();
|
|
|
$build = array();
|
|
|
|
|
|
// 模板中使用JS的标识
|
|
|
$data['guangHome'] = true;
|
|
|
|
|
|
// 顶部的分类列表
|
|
|
foreach ($category['data'] as $value) {
|
|
|
$build = array();
|
|
|
$build['typeId'] = $value['id'];
|
|
|
$build['type'] = $value['name'];
|
|
|
$build['focus'] = ($value['id'] == $type);
|
|
|
$data['navs'][] = $build;
|
|
|
}
|
|
|
|
|
|
$data['guang']['swiper'] = array();
|
|
|
$data['guang']['infos'] = array();
|
|
|
foreach ($articleGroup as $id => $value) {
|
|
|
// 轮番广告
|
|
|
if ($id == 0) {
|
|
|
$build = array();
|
|
|
foreach ($value['list']['adlist'] as $banner) {
|
|
|
$build['url'] = $banner['url'];
|
|
|
$build['img'] = Helpers::getImageUrl($banner['src'], 830, 327);
|
|
|
$data['guang']['swiper'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 内容列表
|
|
|
$build = array();
|
|
|
$build['show'] = ($id == $type);
|
|
|
foreach ($value['list']['artList'] as $article) {
|
|
|
$build['info'][] = Helpers::formatArticle($article, true, false);
|
|
|
}
|
|
|
$data['guang']['infos'][] = $build;
|
|
|
}
|
|
|
|
|
|
// 分页需要参数
|
|
|
$data['guang']['gender'] = $gender;
|
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 列表页
|
|
|
*
|
|
|
* @param string tag 标签名称
|
|
|
*/
|
|
|
public function listAction()
|
|
|
public function tagAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'infos' => array(
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionMan' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('list', array('modulePath' => 'guang/list', 'guang' => $data));
|
|
|
$tag = $this->get('query');
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
|
|
|
// 标签聚合内容列表
|
|
|
$article = ListData::article('', 0, $uid, $udid, 1, $tag);
|
|
|
// 标签聚合内容不存在, 跳到错误页面
|
|
|
if (empty($article['data']['list']['artList'])) {
|
|
|
$this->error();
|
|
|
}
|
|
|
|
|
|
$data = array();
|
|
|
// 模板中使用JS的标识
|
|
|
$data['guangList'] = true;
|
|
|
|
|
|
// 构建资讯文章内容
|
|
|
$build = array();
|
|
|
foreach ($article['data']['list']['artList'] as $article) {
|
|
|
$build[] = Helpers::formatArticle($article, true, false);
|
|
|
}
|
|
|
$data['guang']['infos'] = $build;
|
|
|
|
|
|
// 分页需要的参数
|
|
|
$data['guang']['tag'] = $tag;
|
|
|
|
|
|
$this->setTitle($tag);
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -360,70 +125,104 @@ class ListController extends AbstractAction |
|
|
*/
|
|
|
public function editorAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'author' => array(
|
|
|
'avatar' => 'http://7xidk0.com1.z0.glb.clouddn.com/avater.png',
|
|
|
'name' => '山本耀司',
|
|
|
'info' => '设计理念:他以简洁而富有韵味,线条流畅,反时尚的设计风格而著称。'
|
|
|
),
|
|
|
'infos' => array(
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionMan' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 1,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '1.副线不知为何总是好看点',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => true,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 459,
|
|
|
'isLiked' => true
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isTip' => true
|
|
|
),
|
|
|
array(
|
|
|
'id' => 2,
|
|
|
'img' => 'http://7xidk0.com1.z0.glb.clouddn.com/bg.png',
|
|
|
'title' => '2.副线不知为何总是好看点测试长度是否会被截取塞真的很恶心啊',
|
|
|
'text' => '具有绅士气质的英伦风格是永走前沿的经典,在众多的Made ' .
|
|
|
'In England中Panul Smith缔造了一个传奇',
|
|
|
'showTags' => false,
|
|
|
'publishTime' => '2月13日 12:34',
|
|
|
'pageView' => 3445,
|
|
|
'like' => array(
|
|
|
'count' => 100,
|
|
|
'isLiked' => false
|
|
|
),
|
|
|
'share' => true,
|
|
|
'url' => '',
|
|
|
'likeUrl' => '',
|
|
|
'isFashionGood' => true
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('list', array('modulePath' => 'guang/list', 'guang' => $data));
|
|
|
$id = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
|
|
|
// 获取作者信息
|
|
|
$author = ListData::author($id);
|
|
|
// 作者信息不存在,则跳到错误页面
|
|
|
if (!isset($author['name'])) {
|
|
|
$this->error();
|
|
|
}
|
|
|
|
|
|
$this->setTitle('编辑简介');
|
|
|
|
|
|
$data = array();
|
|
|
// 模板中使用JS的标识
|
|
|
$data['guangList'] = true;
|
|
|
|
|
|
// 作者信息
|
|
|
$data['author'] = array();
|
|
|
$data['author']['avatar'] = Helpers::getImageUrl($author['avatar'], 100, 100);
|
|
|
$data['author']['name'] = $author['name'];
|
|
|
$data['author']['info'] = $author['author_desc'];
|
|
|
$data['author']['id'] = $id;
|
|
|
|
|
|
// 标签聚合内容列表
|
|
|
$article = ListData::article('', 0, $uid, $udid, 1, null, $id);
|
|
|
// 构建资讯文章内容
|
|
|
if (!empty($article['data']['list']['artList'])) {
|
|
|
$build = array();
|
|
|
foreach ($article['data']['list']['artList'] as $article) {
|
|
|
$build[] = Helpers::formatArticle($article, true, false, false);
|
|
|
}
|
|
|
$data['guang']['infos'] = $build;
|
|
|
}
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 逛列表页面的资讯分页
|
|
|
*
|
|
|
* 逛首页、标签页、编辑页资讯列表
|
|
|
*
|
|
|
* @param string tag 标签名称, 没有传空或不传
|
|
|
* @param int type 逛首页的分类ID
|
|
|
* @param int page 分页的页码
|
|
|
* @param string gender "1,2,3"表示所有, "1,3"表示男, "2,3"表示女
|
|
|
* @param int authorId 作者ID
|
|
|
* @return html
|
|
|
*/
|
|
|
public function pageAction()
|
|
|
{
|
|
|
do {
|
|
|
/* 判断是不是AJAX请求 */
|
|
|
if (!$this->isAjax()) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 判断参数是否有效 */
|
|
|
$tag = $this->get('tag');
|
|
|
$sortId = $this->get('type');
|
|
|
$page = $this->get('page');
|
|
|
$gender = $this->get('gender');
|
|
|
$authorId = $this->get('authorId');
|
|
|
$showAuthor = true;
|
|
|
if (!empty($sortId) && !is_numeric($sortId)) {
|
|
|
break;
|
|
|
}
|
|
|
if (!empty($page) && !is_numeric($page)) {
|
|
|
break;
|
|
|
}
|
|
|
if (!empty($authorId) && is_numeric($authorId)) {
|
|
|
$showAuthor = false;
|
|
|
}
|
|
|
|
|
|
/* 获取资讯文章列表 */
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$article = ListData::article($gender, 0, $uid, $udid, $page, $tag, $authorId);
|
|
|
if (empty($article['data']['list']['artList'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 构建资讯文章内容 */
|
|
|
$data = array();
|
|
|
$build = array();
|
|
|
foreach ($article['data']['list']['artList'] as $article) {
|
|
|
$build[] = Helpers::formatArticle($article, true, false, $showAuthor);
|
|
|
}
|
|
|
$data['infos'] = $build;
|
|
|
|
|
|
$this->_view->display('page', $data);
|
|
|
|
|
|
exit();
|
|
|
}
|
|
|
while (false);
|
|
|
|
|
|
echo ' ';
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|