update Home.php to remove unnecessary condition. code review by HongFei
Showing
1 changed file
with
17 additions
and
17 deletions
@@ -10,7 +10,7 @@ use Configs\CacheConfig; | @@ -10,7 +10,7 @@ use Configs\CacheConfig; | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 首页相关的模板数据模型 | 12 | * 首页相关的模板数据模型 |
13 | - * | 13 | + * |
14 | * @name HomeModel | 14 | * @name HomeModel |
15 | * @package models | 15 | * @package models |
16 | * @copyright yoho.inc | 16 | * @copyright yoho.inc |
@@ -52,7 +52,7 @@ class HomeModel | @@ -52,7 +52,7 @@ class HomeModel | ||
52 | 52 | ||
53 | /** | 53 | /** |
54 | * 选择频道 | 54 | * 选择频道 |
55 | - * | 55 | + * |
56 | * @return void | 56 | * @return void |
57 | */ | 57 | */ |
58 | public static function goSwitchChannel() | 58 | public static function goSwitchChannel() |
@@ -70,7 +70,7 @@ class HomeModel | @@ -70,7 +70,7 @@ class HomeModel | ||
70 | 70 | ||
71 | /** | 71 | /** |
72 | * 设置选择的频道保存到浏览器COOKIE | 72 | * 设置选择的频道保存到浏览器COOKIE |
73 | - * | 73 | + * |
74 | * @param string $cookie | 74 | * @param string $cookie |
75 | * @return void | 75 | * @return void |
76 | */ | 76 | */ |
@@ -81,7 +81,7 @@ class HomeModel | @@ -81,7 +81,7 @@ class HomeModel | ||
81 | 81 | ||
82 | /** | 82 | /** |
83 | * 获取频道选择页的背景图片 | 83 | * 获取频道选择页的背景图片 |
84 | - * | 84 | + * |
85 | * @return string | false | 85 | * @return string | false |
86 | */ | 86 | */ |
87 | public static function getBgImage() | 87 | public static function getBgImage() |
@@ -122,7 +122,7 @@ class HomeModel | @@ -122,7 +122,7 @@ class HomeModel | ||
122 | 122 | ||
123 | /** | 123 | /** |
124 | * 获取男生,女生底部banner | 124 | * 获取男生,女生底部banner |
125 | - * | 125 | + * |
126 | * @return string | false | 126 | * @return string | false |
127 | */ | 127 | */ |
128 | public static function getBottomBanner($channel) | 128 | public static function getBottomBanner($channel) |
@@ -164,7 +164,7 @@ class HomeModel | @@ -164,7 +164,7 @@ class HomeModel | ||
164 | } | 164 | } |
165 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | 165 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 |
166 | else { | 166 | else { |
167 | - Cache::set($cache, $result); | 167 | + Cache::set($cache, $result); |
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||
@@ -173,7 +173,7 @@ class HomeModel | @@ -173,7 +173,7 @@ class HomeModel | ||
173 | 173 | ||
174 | /** | 174 | /** |
175 | * 获取男生首页的楼层数据 | 175 | * 获取男生首页的楼层数据 |
176 | - * | 176 | + * |
177 | * @return array | false | 177 | * @return array | false |
178 | */ | 178 | */ |
179 | public static function getBoysFloor() | 179 | public static function getBoysFloor() |
@@ -204,13 +204,13 @@ class HomeModel | @@ -204,13 +204,13 @@ class HomeModel | ||
204 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); | 204 | Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result); |
205 | } | 205 | } |
206 | } | 206 | } |
207 | - | 207 | + |
208 | return $result; | 208 | return $result; |
209 | } | 209 | } |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * 获取女生首页的楼层数据 | 212 | * 获取女生首页的楼层数据 |
213 | - * | 213 | + * |
214 | * @return array | false | 214 | * @return array | false |
215 | */ | 215 | */ |
216 | public static function getGirlsFloor() | 216 | public static function getGirlsFloor() |
@@ -247,7 +247,7 @@ class HomeModel | @@ -247,7 +247,7 @@ class HomeModel | ||
247 | 247 | ||
248 | /** | 248 | /** |
249 | * 获取潮童首页的楼层数据 | 249 | * 获取潮童首页的楼层数据 |
250 | - * | 250 | + * |
251 | * @return array | false | 251 | * @return array | false |
252 | */ | 252 | */ |
253 | public static function getKidsFloor() | 253 | public static function getKidsFloor() |
@@ -284,7 +284,7 @@ class HomeModel | @@ -284,7 +284,7 @@ class HomeModel | ||
284 | 284 | ||
285 | /** | 285 | /** |
286 | * 获取创意生活首页的楼层数据 | 286 | * 获取创意生活首页的楼层数据 |
287 | - * | 287 | + * |
288 | * @return array | false | 288 | * @return array | false |
289 | */ | 289 | */ |
290 | public static function getLifestyleFloor() | 290 | public static function getLifestyleFloor() |
@@ -318,20 +318,20 @@ class HomeModel | @@ -318,20 +318,20 @@ class HomeModel | ||
318 | 318 | ||
319 | return $result; | 319 | return $result; |
320 | } | 320 | } |
321 | - | 321 | + |
322 | /** | 322 | /** |
323 | * 获取频道选择页数据 | 323 | * 获取频道选择页数据 |
324 | - * | 324 | + * |
325 | * @return array | 325 | * @return array |
326 | */ | 326 | */ |
327 | public static function getChannel(){ | 327 | public static function getChannel(){ |
328 | $result = array(); | 328 | $result = array(); |
329 | $result['showYohood'] = false; | 329 | $result['showYohood'] = false; |
330 | - | 330 | + |
331 | $data = IndexData::channelData(); | 331 | $data = IndexData::channelData(); |
332 | - | 332 | + |
333 | $channelList = array(); | 333 | $channelList = array(); |
334 | - if($data['code'] == 200 && isset($data['data']['list'])){ | 334 | + if(isset($data['data']['list'])){ |
335 | foreach($data['data']['list'] as $key => $value){ | 335 | foreach($data['data']['list'] as $key => $value){ |
336 | switch ($value['channel_id']) { | 336 | switch ($value['channel_id']) { |
337 | case 5: | 337 | case 5: |
@@ -364,7 +364,7 @@ class HomeModel | @@ -364,7 +364,7 @@ class HomeModel | ||
364 | } | 364 | } |
365 | $result['channelList'] = $channelList; | 365 | $result['channelList'] = $channelList; |
366 | } | 366 | } |
367 | - | 367 | + |
368 | return $result; | 368 | return $result; |
369 | } | 369 | } |
370 | 370 |
-
Please register or login to post a comment