Showing
1 changed file
with
20 additions
and
4 deletions
@@ -9,7 +9,7 @@ use Plugin\Helpers; | @@ -9,7 +9,7 @@ use Plugin\Helpers; | ||
9 | */ | 9 | */ |
10 | class FloorProcess | 10 | class FloorProcess |
11 | { | 11 | { |
12 | - | 12 | + private static $guangUrl = 'http://guang.m.yohobuy.com'; |
13 | /** | 13 | /** |
14 | * 频道参数 | 14 | * 频道参数 |
15 | * | 15 | * |
@@ -218,20 +218,29 @@ class FloorProcess | @@ -218,20 +218,29 @@ class FloorProcess | ||
218 | { | 218 | { |
219 | $result = array(); | 219 | $result = array(); |
220 | 220 | ||
221 | - foreach ($data['article'] as &$one) { | 221 | + foreach($data as $key=>&$value){ |
222 | + if($key == 'title'){ | ||
223 | + $value['more_url'] = self::$guangUrl.'?id=2&gender='.self::$channel[$type]; | ||
224 | + } | ||
225 | + if($key == 'article'){ | ||
226 | + foreach($value as &$one){ | ||
222 | if (isset($one['url'])) { | 227 | if (isset($one['url'])) { |
223 | $one['url'] = Helpers::getFilterUrl($one['url']); | 228 | $one['url'] = Helpers::getFilterUrl($one['url']); |
224 | } | 229 | } |
225 | $one['img'] = Helpers::getImageUrl($one['src'], 400, 400); | 230 | $one['img'] = Helpers::getImageUrl($one['src'], 400, 400); |
226 | unset($one['src']); | 231 | unset($one['src']); |
227 | } | 232 | } |
228 | - foreach ($data['recommend_collocation'] as &$one) { | 233 | + } |
234 | + if($key == 'recommend_collocation'){ | ||
235 | + foreach($value as &$one){ | ||
229 | if (isset($one['url'])) { | 236 | if (isset($one['url'])) { |
230 | $one['url'] = Helpers::getFilterUrl($one['url']); | 237 | $one['url'] = Helpers::getFilterUrl($one['url']); |
231 | } | 238 | } |
232 | $one['img'] = Helpers::getImageUrl($one['src'], 140, 140); | 239 | $one['img'] = Helpers::getImageUrl($one['src'], 140, 140); |
233 | unset($one['src']); | 240 | unset($one['src']); |
234 | } | 241 | } |
242 | + } | ||
243 | + } | ||
235 | $result['trendColloaction'] = $data; | 244 | $result['trendColloaction'] = $data; |
236 | 245 | ||
237 | return $result; | 246 | return $result; |
@@ -247,13 +256,20 @@ class FloorProcess | @@ -247,13 +256,20 @@ class FloorProcess | ||
247 | { | 256 | { |
248 | $result = array(); | 257 | $result = array(); |
249 | 258 | ||
250 | - foreach ($data['list'] as &$one) { | 259 | + foreach($data as $key=>&$value){ |
260 | + if($key == 'title'){ | ||
261 | + $value['more_url'] = self::$guangUrl.'?id=1&gender='.self::$channel[$type]; | ||
262 | + } | ||
263 | + if($key == 'list'){ | ||
264 | + foreach ($value as &$one) { | ||
251 | if (isset($one['url'])) { | 265 | if (isset($one['url'])) { |
252 | $one['url'] = Helpers::getFilterUrl($one['url']); | 266 | $one['url'] = Helpers::getFilterUrl($one['url']); |
253 | } | 267 | } |
254 | $one['img'] = Helpers::getImageUrl($one['src'], 580, 360); | 268 | $one['img'] = Helpers::getImageUrl($one['src'], 580, 360); |
255 | unset($one['src']); | 269 | unset($one['src']); |
256 | } | 270 | } |
271 | + } | ||
272 | + } | ||
257 | $result['trendTopics'] = $data; | 273 | $result['trendTopics'] = $data; |
258 | 274 | ||
259 | return $result; | 275 | return $result; |
-
Please register or login to post a comment