...
|
...
|
@@ -359,7 +359,7 @@ class Helpers |
|
|
$result['id'] = $articleData['id'];
|
|
|
$result['classification'] = $articleData['category_name'];
|
|
|
$result['isReco'] = $articleData['is_recommended'] ? true : false;
|
|
|
$result['url'] = $isApp ? $articleData['url'] : self::url('/'.$articleData['id'].'.html', array(), 'guang');
|
|
|
$result['url'] = self::getArticleUrl($articleData['url'], $articleData['id'], $isApp);
|
|
|
$result['img'] = self::getImageUrl($articleData['src'], $width, $height, 1);
|
|
|
$result['isSquareImg'] = $isSquareImage;
|
|
|
$result['title'] = $articleData['title'];
|
...
|
...
|
@@ -1146,4 +1146,34 @@ class Helpers |
|
|
}
|
|
|
return 'http:';
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获得文章 url
|
|
|
* @param type string url 后台返回的url
|
|
|
* @param type $productSkn 产品编号
|
|
|
* @param type $productName 产品名称
|
|
|
* @param type $cnAlphaBet
|
|
|
* @return type url
|
|
|
*/
|
|
|
public static function getArticleUrl($url, $id, $isApp = false)
|
|
|
{
|
|
|
$rurl;
|
|
|
|
|
|
if(!empty($url)) {
|
|
|
|
|
|
try {
|
|
|
$jurl = json_decode($url);
|
|
|
|
|
|
if(!empty($jurl) && !empty($jurl->url)) {
|
|
|
$rurl = $jurl->url;
|
|
|
}
|
|
|
} catch(Exception $e){}
|
|
|
}
|
|
|
|
|
|
if(empty($rurl)) {
|
|
|
$rurl = $isApp ? $url : self::url('/'.$id.'.html', array(), 'guang');
|
|
|
}
|
|
|
|
|
|
return $rurl;
|
|
|
}
|
|
|
} |
...
|
...
|
|