modify to fixes bug guang author list show author info repeat
Showing
3 changed files
with
12 additions
and
8 deletions
@@ -265,8 +265,11 @@ class Helpers | @@ -265,8 +265,11 @@ class Helpers | ||
265 | $result['share'] = $isApp && isset($articleData['share']['url']) ? $articleData['share']['url'] : false; | 265 | $result['share'] = $isApp && isset($articleData['share']['url']) ? $articleData['share']['url'] : false; |
266 | 266 | ||
267 | // 判断是否显示作者信息 | 267 | // 判断是否显示作者信息 |
268 | - if ($showAuthor) { | ||
269 | - $result['author'] = empty($articleData['author']) ? false : $articleData['author']; | 268 | + if ($showAuthor && !empty($articleData['author'])) { |
269 | + if (!$isApp) { | ||
270 | + $articleData['author']['url'] = Helpers::getFilterUrl($articleData['author']['url']); | ||
271 | + } | ||
272 | + $result['author'] = $articleData['author']; | ||
270 | } | 273 | } |
271 | 274 | ||
272 | // 模板中需要的标签标识 | 275 | // 模板中需要的标签标识 |
@@ -81,6 +81,7 @@ class ListModel | @@ -81,6 +81,7 @@ class ListModel | ||
81 | if (isset($introData['data']['brand_intro'])) { | 81 | if (isset($introData['data']['brand_intro'])) { |
82 | $result['id'] = $id; | 82 | $result['id'] = $id; |
83 | $result['intro'] = $introData['data']['brand_intro']; | 83 | $result['intro'] = $introData['data']['brand_intro']; |
84 | + $result['collected'] = (isset($introData['data']['is_favorite']) && $introData['data']['is_favorite'] == 'Y') ? true : false; | ||
84 | // 顶部导航的标题 | 85 | // 顶部导航的标题 |
85 | $title = isset($introData['data']['brand_name']) ? $introData['data']['brand_name'] : ''; | 86 | $title = isset($introData['data']['brand_name']) ? $introData['data']['brand_name'] : ''; |
86 | } | 87 | } |
@@ -154,11 +154,11 @@ class IndexController extends AbstractAction | @@ -154,11 +154,11 @@ class IndexController extends AbstractAction | ||
154 | $data['guangList'] = true; | 154 | $data['guangList'] = true; |
155 | 155 | ||
156 | // 作者信息 | 156 | // 作者信息 |
157 | - $data['author'] = array(); | ||
158 | - $data['author']['avatar'] = Helpers::getImageUrl($author['avatar'], 100, 100); | ||
159 | - $data['author']['name'] = $author['name']; | ||
160 | - $data['author']['info'] = $author['author_desc']; | ||
161 | - $data['author']['id'] = $id; | 157 | + $data['authorInfo'] = array(); |
158 | + $data['authorInfo']['avatar'] = Helpers::getImageUrl($author['avatar'], 100, 100); | ||
159 | + $data['authorInfo']['name'] = $author['name']; | ||
160 | + $data['authorInfo']['info'] = $author['author_desc']; | ||
161 | + $data['authorInfo']['id'] = $id; | ||
162 | 162 | ||
163 | // 标签聚合内容列表 | 163 | // 标签聚合内容列表 |
164 | $article = ListData::article($gender, 0, $uid, $udid, 1, null, $id); | 164 | $article = ListData::article($gender, 0, $uid, $udid, 1, null, $id); |
@@ -166,7 +166,7 @@ class IndexController extends AbstractAction | @@ -166,7 +166,7 @@ class IndexController extends AbstractAction | ||
166 | if (!empty($article['data']['list']['artList'])) { | 166 | if (!empty($article['data']['list']['artList'])) { |
167 | $build = array(); | 167 | $build = array(); |
168 | foreach ($article['data']['list']['artList'] as $article) { | 168 | foreach ($article['data']['list']['artList'] as $article) { |
169 | - $build[] = Helpers::formatArticle($article, true, $isApp, false); | 169 | + $build[] = Helpers::formatArticle($article, true, $isApp, false); |
170 | } | 170 | } |
171 | $data['guang']['infos'] = $build; | 171 | $data['guang']['infos'] = $build; |
172 | } | 172 | } |
-
Please register or login to post a comment