...
|
...
|
@@ -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()
|
...
|
...
|
@@ -319,4 +319,53 @@ class HomeModel |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取频道选择页数据
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getChannel(){
|
|
|
$result = array();
|
|
|
$result['showYohood'] = false;
|
|
|
|
|
|
$data = IndexData::channelData();
|
|
|
|
|
|
$channelList = array();
|
|
|
if(isset($data['data']['list'])){
|
|
|
foreach($data['data']['list'] as $key => $value){
|
|
|
switch ($value['channel_id']) {
|
|
|
case 5:
|
|
|
$result['showYohood'] = true;
|
|
|
$result['yohoodHref'] = '/yohood';
|
|
|
break;
|
|
|
case 1:
|
|
|
$channelList[$key]['href'] = '/boys';
|
|
|
$channelList[$key]['title'] = '男生';
|
|
|
$channelList[$key]['entitle'] = 'BOYS';
|
|
|
break;
|
|
|
case 2:
|
|
|
$channelList[$key]['href'] = '/girls';
|
|
|
$channelList[$key]['title'] = '女生';
|
|
|
$channelList[$key]['entitle'] = 'GIRLS';
|
|
|
break;
|
|
|
case 3:
|
|
|
$channelList[$key]['href'] = '/kids';
|
|
|
$channelList[$key]['title'] = '潮童';
|
|
|
$channelList[$key]['entitle'] = 'KIDS';
|
|
|
break;
|
|
|
case 4:
|
|
|
$channelList[$key]['href'] = '/lifestyle';
|
|
|
$channelList[$key]['title'] = '创意生活';
|
|
|
$channelList[$key]['entitle'] = 'LIFESTYLE';
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
$result['channelList'] = $channelList;
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|