|
@@ -19,16 +19,17 @@ use Configs\CacheConfig; |
|
@@ -19,16 +19,17 @@ use Configs\CacheConfig; |
19
|
class ChannelModel
|
19
|
class ChannelModel
|
20
|
{
|
20
|
{
|
21
|
|
21
|
|
22
|
- const CODE_FLOOR_JCSHOP = 'cdcc581da92a13c74e3bf1826f1806d1';
|
22
|
+ const CHANNEl_CODE = 'cdcc581da92a13c74e3bf1826f1806d1';
|
23
|
|
23
|
|
24
|
/**
|
24
|
/**
|
25
|
* 获取男生首页的楼层数据
|
25
|
* 获取男生首页的楼层数据
|
26
|
*
|
26
|
*
|
27
|
* @return array | false
|
27
|
* @return array | false
|
28
|
*/
|
28
|
*/
|
29
|
- public static function getChannelFloor()
|
29
|
+ public static function getChannelFloor($contentCode)
|
30
|
{
|
30
|
{
|
31
|
$result = array();
|
31
|
$result = array();
|
|
|
32
|
+ $contentCode = !empty($contentCode) ? $contentCode : self::CHANNEl_CODE;
|
32
|
|
33
|
|
33
|
if (USE_CACHE) {
|
34
|
if (USE_CACHE) {
|
34
|
// 先尝试获取一级缓存(master), 有数据则直接返回.
|
35
|
// 先尝试获取一级缓存(master), 有数据则直接返回.
|
|
@@ -39,7 +40,7 @@ class ChannelModel |
|
@@ -39,7 +40,7 @@ class ChannelModel |
39
|
}
|
40
|
}
|
40
|
|
41
|
|
41
|
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
|
42
|
// 调用接口获取楼层数据, 并封装成模板渲染需要的数据格式
|
42
|
- $channelData = ChannelData::getChannelData(self::CODE_FLOOR_JCSHOP);
|
43
|
+ $channelData = ChannelData::getChannelData($contentCode);
|
43
|
|
44
|
|
44
|
if (isset($channelData['code']) && $channelData['code'] == 200) {
|
45
|
if (isset($channelData['code']) && $channelData['code'] == 200) {
|
45
|
$channelData = array(
|
46
|
$channelData = array(
|
|
@@ -61,4 +62,4 @@ class ChannelModel |
|
@@ -61,4 +62,4 @@ class ChannelModel |
61
|
|
62
|
|
62
|
return $result;
|
63
|
return $result;
|
63
|
}
|
64
|
}
|
64
|
-} |
|
|
|
|
65
|
+} |