Authored by biao

update Home.php to remove unnecessary condition. code review by HongFei

... ... @@ -10,7 +10,7 @@ use Configs\CacheConfig;
/**
* 首页相关的模板数据模型
*
*
* @name HomeModel
* @package models
* @copyright yoho.inc
... ... @@ -52,7 +52,7 @@ class HomeModel
/**
* 选择频道
*
*
* @return void
*/
public static function goSwitchChannel()
... ... @@ -70,7 +70,7 @@ class HomeModel
/**
* 设置选择的频道保存到浏览器COOKIE
*
*
* @param string $cookie
* @return void
*/
... ... @@ -81,7 +81,7 @@ class HomeModel
/**
* 获取频道选择页的背景图片
*
*
* @return string | false
*/
public static function getBgImage()
... ... @@ -122,7 +122,7 @@ class HomeModel
/**
* 获取男生,女生底部banner
*
*
* @return string | false
*/
public static function getBottomBanner($channel)
... ... @@ -164,7 +164,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
Cache::set($cache, $result);
}
}
... ... @@ -173,7 +173,7 @@ class HomeModel
/**
* 获取男生首页的楼层数据
*
*
* @return array | false
*/
public static function getBoysFloor()
... ... @@ -204,13 +204,13 @@ class HomeModel
Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result);
}
}
return $result;
}
/**
* 获取女生首页的楼层数据
*
*
* @return array | false
*/
public static function getGirlsFloor()
... ... @@ -247,7 +247,7 @@ class HomeModel
/**
* 获取潮童首页的楼层数据
*
*
* @return array | false
*/
public static function getKidsFloor()
... ... @@ -284,7 +284,7 @@ class HomeModel
/**
* 获取创意生活首页的楼层数据
*
*
* @return array | false
*/
public static function getLifestyleFloor()
... ... @@ -318,20 +318,20 @@ class HomeModel
return $result;
}
/**
* 获取频道选择页数据
*
*
* @return array
*/
public static function getChannel(){
$result = array();
$result['showYohood'] = false;
$data = IndexData::channelData();
$channelList = array();
if($data['code'] == 200 && isset($data['data']['list'])){
if(isset($data['data']['list'])){
foreach($data['data']['list'] as $key => $value){
switch ($value['channel_id']) {
case 5:
... ... @@ -364,7 +364,7 @@ class HomeModel
}
$result['channelList'] = $channelList;
}
return $result;
}
... ...