...
|
...
|
@@ -41,7 +41,7 @@ class InfoController extends AbstractAction |
|
|
$data['guang']['author']['avatar'] = $detail['getAuthor']['avatar'];
|
|
|
$data['guang']['author']['name'] = $detail['getAuthor']['name'];
|
|
|
$data['guang']['author']['intro'] = $detail['getAuthor']['author_desc'];
|
|
|
$data['guang']['author']['url'] = '/author/index?id=' . $detail['getArticle']['author_id'];
|
|
|
$data['guang']['author']['url'] = Helpers::url('/author/index', array('id' => $detail['getArticle']['author_id']), 'guang');
|
|
|
}
|
|
|
|
|
|
$data['detail'] = array();
|
...
|
...
|
@@ -55,17 +55,27 @@ class InfoController extends AbstractAction |
|
|
$good = array();
|
|
|
$skns = array();
|
|
|
$product = array();
|
|
|
|
|
|
foreach ($detail['getArticleContent'] as $value) {
|
|
|
$build = array();
|
|
|
// 文字
|
|
|
if (isset($value['text'])) {
|
|
|
$build['text'] = $value['text']['data']['text'];
|
|
|
$data['detail']['content'][] = $build;
|
|
|
}
|
|
|
// 单张图
|
|
|
elseif (isset($value['singleImage'])) {
|
|
|
$build['bigImage'] = Helpers::getImageUrl($value['singleImage']['data'][0]['src'], 640, 640);
|
|
|
$data['detail']['content'][] = $build;
|
|
|
}
|
|
|
elseif (isset($value['smallPic'])) {
|
|
|
$imgs = $value['smallPic']['data'];
|
|
|
$build['smallImage'] = array(
|
|
|
array(
|
|
|
'src' => Helpers::getImageUrl($imgs[0]['src'], 315, 420)
|
|
|
),
|
|
|
array(
|
|
|
'src' => Helpers::getImageUrl($imgs[1]['src'], 315, 420)
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
// 相关推荐
|
|
|
elseif (isset($value['goods']['data'])) {
|
...
|
...
|
@@ -133,7 +143,7 @@ class InfoController extends AbstractAction |
|
|
// 相关标签
|
|
|
if (!empty($detail['getArticle']['tags'])) {
|
|
|
foreach ($detail['getArticle']['tags'] as $value) {
|
|
|
$value['url'] = '/tags/index?query=' . $value['name'];
|
|
|
$value['url'] = Helpers::url('/tags/index', array('query=' => $value['name']), 'guang');
|
|
|
$data['relatedTag'][] = $value;
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -141,11 +151,12 @@ class InfoController extends AbstractAction |
|
|
// 相关文章
|
|
|
if (!empty($detail['getOtherArticle'])) {
|
|
|
foreach ($detail['getOtherArticle'] as $value) {
|
|
|
$value['url'] = '/info/index?id=' . $value['id'];
|
|
|
$value['url'] = Helpers::url('/info/index', array('id' => $value['id']), 'guang');
|
|
|
$value['thumb'] = Helpers::getImageUrl($value['thumb'], 279, 175);
|
|
|
$data['relatedInfo'][] = $value;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
$this->_view->display('index', $data);
|
|
|
|
|
|
$detail = array();
|
...
|
...
|
|