Authored by biao

update to fix guang bug

... ... @@ -14,7 +14,7 @@ class InfoController extends AbstractAction
/**
* 详情页
*
*
* @param int id 内容ID
*/
public function indexAction()
... ... @@ -46,7 +46,7 @@ class InfoController extends AbstractAction
if (isset($detail['code']) && $detail['code'] === 400) {
$this->error();
}
if (empty($detail['getArticle'])) {
$this->_view->display('index', $data);
return;
... ... @@ -76,7 +76,7 @@ class InfoController extends AbstractAction
foreach ($detail['getArticleContent'] as $value) {
$build = array();
// 文字
if (isset($value['text'])) {
if (isset($value['text']['data']['text'])) {
$build['text'] = $value['text']['data']['text'];
}
// 单张图
... ... @@ -231,7 +231,7 @@ class InfoController extends AbstractAction
/**
* APP里使用的收藏内容的接口
*
*
* @param id 资讯ID
* @param type "fav"表示收藏 或者 "cancel"表示取消收藏
* @return json
... ... @@ -277,7 +277,7 @@ class InfoController extends AbstractAction
// 单张图
elseif (isset($value['singleImage'])) {
$build['bigImage'] = Helpers::getImageUrl($value['singleImage']['data'][0]['src'], 640, 640);
}
}
elseif (isset($value['smallPic']['data'])) {
$imgs = $value['smallPic']['data'];
$build['smallImage'] = array(
... ... @@ -376,36 +376,36 @@ class InfoController extends AbstractAction
$detail = array();
$data = array();
}
/**
* 提供给YOHO资讯站调用的接口
*
*
* @param int id 逛内容ID
* @return json
*/
public function foryohoAction()
{
$result = array();
do {
/* 判断参数是否有效 */
$id = $this->get('id');
if (!is_numeric($id)) {
break;
}
$app = $this->get('app');
$isApp = empty($app) ? false : true;
/* 判断是否有内容 */
$detail = DetailData::package($id, $isApp);
if (empty($detail['getArticleContent'])) {
break;
}
/* 品牌信息 */
$result['brand'] = $detail['getBrand'];
$build = array();
$good = array();
$skns = array();
... ... @@ -421,7 +421,7 @@ class InfoController extends AbstractAction
// 单张图
elseif (isset($value['singleImage'])) {
$build['bigImage'] = Helpers::getImageUrl($value['singleImage']['data'][0]['src'], 640, 640);
}
}
elseif (isset($value['smallPic']['data'])) {
$imgs = $value['smallPic']['data'];
$build['smallImage'] = array(
... ... @@ -482,15 +482,15 @@ class InfoController extends AbstractAction
elseif (isset($value['link'])) {
$build['moreLink'] = $value['link']['data'][0]['url'];
}
// 内容详情
if (array() !== $build) {
$result['content'][] = $build;
}
}
}
}
while (false);
$this->echoJson($result);
}
... ...