Showing
1 changed file
with
10 additions
and
6 deletions
@@ -103,7 +103,7 @@ class IndexModel | @@ -103,7 +103,7 @@ class IndexModel | ||
103 | * | 103 | * |
104 | * @param string $gender "1,3"表示男, "2,3"表示女 | 104 | * @param string $gender "1,3"表示男, "2,3"表示女 |
105 | * @param int channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活 | 105 | * @param int channel APP客户端标识 1表示男,2:表示女,3:潮童,4:创意生活 |
106 | - * @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士 | 106 | + * @param int type 分类ID 0:最新,1:话题,2:搭配,3:潮人,4:潮品,5:小贴士,59:专题 |
107 | * @param int $uid 用户ID | 107 | * @param int $uid 用户ID |
108 | * @param string $udid 客户端唯一标识 | 108 | * @param string $udid 客户端唯一标识 |
109 | * @param int $page 分页第几页, 默认第1页 | 109 | * @param int $page 分页第几页, 默认第1页 |
@@ -143,17 +143,23 @@ class IndexModel | @@ -143,17 +143,23 @@ class IndexModel | ||
143 | $key = CacheConfig::KEY_ACTION_GUANG_LIST_DATA . sprintf('%s_%s_%s', $gender, $type, $page); | 143 | $key = CacheConfig::KEY_ACTION_GUANG_LIST_DATA . sprintf('%s_%s_%s', $gender, $type, $page); |
144 | 144 | ||
145 | // 顶部的分类列表 | 145 | // 顶部的分类列表 |
146 | + $curIndex=0;//当前tab顺序 | ||
146 | if (!empty($category['data'])) { | 147 | if (!empty($category['data'])) { |
148 | + $indexTmp = 0; | ||
147 | foreach ($category['data'] as $value) { | 149 | foreach ($category['data'] as $value) { |
148 | $build = array(); | 150 | $build = array(); |
149 | $build['typeId'] = $value['id']; | 151 | $build['typeId'] = $value['id']; |
150 | $build['type'] = $value['name']; | 152 | $build['type'] = $value['name']; |
151 | $build['focus'] = ($value['id'] == $type); | 153 | $build['focus'] = ($value['id'] == $type); |
152 | $data['navs'][] = $build; | 154 | $data['navs'][] = $build; |
153 | - $data['guang']['infos'][] = array( | 155 | + $data['guang']['infos'][$indexTmp] = array( |
154 | 'show' => $build['focus'], | 156 | 'show' => $build['focus'], |
155 | 'info' => array(), | 157 | 'info' => array(), |
156 | ); | 158 | ); |
159 | + if($build['focus']){ | ||
160 | + $curIndex = $indexTmp; | ||
161 | + } | ||
162 | + $indexTmp++; | ||
157 | } | 163 | } |
158 | } | 164 | } |
159 | 165 | ||
@@ -182,11 +188,11 @@ class IndexModel | @@ -182,11 +188,11 @@ class IndexModel | ||
182 | 188 | ||
183 | // 内容列表 | 189 | // 内容列表 |
184 | if (!empty($article['data']['list']['artList'])) { | 190 | if (!empty($article['data']['list']['artList'])) { |
185 | - $type = intval($type); | ||
186 | foreach ($article['data']['list']['artList'] as $value) { | 191 | foreach ($article['data']['list']['artList'] as $value) { |
187 | - $data['guang']['infos'][$type]['info'][] = Helpers::formatArticle($value, true, false, true); | 192 | + $data['guang']['infos'][$curIndex]['info'][] = Helpers::formatArticle($value, true, false, true); |
188 | } | 193 | } |
189 | 194 | ||
195 | + | ||
190 | if (USE_CACHE) { | 196 | if (USE_CACHE) { |
191 | $result = Cache::get($key, 'master'); | 197 | $result = Cache::get($key, 'master'); |
192 | if (empty($result)) { | 198 | if (empty($result)) { |
@@ -205,7 +211,6 @@ class IndexModel | @@ -205,7 +211,6 @@ class IndexModel | ||
205 | 211 | ||
206 | $category = array(); | 212 | $category = array(); |
207 | $article = array(); | 213 | $article = array(); |
208 | - | ||
209 | return $data; | 214 | return $data; |
210 | } | 215 | } |
211 | 216 | ||
@@ -356,7 +361,6 @@ class IndexModel | @@ -356,7 +361,6 @@ class IndexModel | ||
356 | } | 361 | } |
357 | $result['infos'] = $build; | 362 | $result['infos'] = $build; |
358 | } while (false); | 363 | } while (false); |
359 | - | ||
360 | return $result; | 364 | return $result; |
361 | } | 365 | } |
362 | 366 |
-
Please register or login to post a comment