Showing
1 changed file
with
10 additions
and
22 deletions
@@ -1149,31 +1149,19 @@ class Helpers | @@ -1149,31 +1149,19 @@ class Helpers | ||
1149 | 1149 | ||
1150 | /** | 1150 | /** |
1151 | * 获得文章 url | 1151 | * 获得文章 url |
1152 | - * @param type string url 后台返回的url | ||
1153 | - * @param type $productSkn 产品编号 | ||
1154 | - * @param type $productName 产品名称 | ||
1155 | - * @param type $cnAlphaBet | ||
1156 | - * @return type url | 1152 | + * @param string url 后台返回的url |
1153 | + * @param int $id 文章id | ||
1154 | + * @return string $rurl | ||
1157 | */ | 1155 | */ |
1158 | - public static function getArticleUrl($url, $id, $isApp = false) | 1156 | + public static function getArticleUrl($url, $id) |
1159 | { | 1157 | { |
1160 | - $rurl; | ||
1161 | - | ||
1162 | - if(!empty($url)) { | ||
1163 | - | ||
1164 | - try { | ||
1165 | - $jurl = json_decode($url); | ||
1166 | - | ||
1167 | - if(!empty($jurl) && !empty($jurl->url)) { | ||
1168 | - $rurl = $jurl->url; | ||
1169 | - } | ||
1170 | - } catch(Exception $e){} | ||
1171 | - } | ||
1172 | - | ||
1173 | - if(empty($rurl)) { | ||
1174 | - $rurl = $isApp ? $url : self::url('/'.$id.'.html', array(), 'guang'); | 1158 | + $jurl = json_decode($url); |
1159 | + if(!empty($jurl) && isset($jurl['url']) && !empty($jurl['url'])) { | ||
1160 | + $rurl = $jurl['url']; | ||
1161 | + } else { | ||
1162 | + $rurl = self::url('/'.$id.'.html', array(), 'guang'); | ||
1175 | } | 1163 | } |
1176 | - | 1164 | + |
1177 | return $rurl; | 1165 | return $rurl; |
1178 | } | 1166 | } |
1179 | } | 1167 | } |
-
Please register or login to post a comment