Authored by hf

fixes bug to newsale page show banner link

... ... @@ -25,14 +25,8 @@ class CacheConfig
const KEY_ACTION_GUANG_PLUSSTAR_INDEX = 'key_action_guang_plusstar_index'; // 国际优选
const KEY_ACTION_GUANG_PLUSSTAR_LIST = 'key_action_guang_plusstar_list'; // 明星原创
const KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS = 'key_action_product_newsale_index_bodys'; // 男生新品到着
const KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS = 'key_action_product_newsale_index_girls'; // 女生新品到着
const KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS = 'key_action_product_newsale_index_kids'; // 潮童新品到着
const KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE = 'key_action_product_newsale_index_lifestyle'; // 创意生活新品到着
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS = 'key_action_product_newsale_discount_boys'; // 男生折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS = 'key_action_product_newsale_discount_girls'; // 女生折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS = 'key_action_product_newsale_discount_kids'; // 潮童折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE = 'key_action_product_newsale_discount_lifestyle'; // 创意生活折扣专区
const KEY_ACTION_PRODUCT_NEWSALE_INDEX = 'key_action_product_newsale_index'; // 新品到着
const KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT = 'key_action_product_newsale_discount'; // 热卖排行
const KEY_ACTION_PRODUCT_INDEX = 'key_action_product_index'; // 品类商品列表
const KEY_ACTION_PRODUCT_BRAND = 'key_action_product_brand'; // 品类商品列表
... ...
... ... @@ -45,16 +45,16 @@ class NewsaleModel
/* 根据频道调用接口 */
switch (intval($channel)) {
case 1: // 男生
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_BOYS, self::CODE_TOP_NEW_BOYS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_BOYS);
break;
case 2: // 女生
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_GIRLS, self::CODE_TOP_NEW_GIRLS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_GIRLS);
break;
case 3: // 潮童
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_KIDS, self::CODE_TOP_NEW_KIDS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_KIDS);
break;
case 4: // 创意生活
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX_LIFESTYLE, self::CODE_TOP_NEW_LIFESTYLE);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_INDEX, self::CODE_TOP_NEW_LIFESTYLE);
break;
}
... ... @@ -73,16 +73,16 @@ class NewsaleModel
/* 根据频道调用接口 */
switch (intval($channel)) {
case 1: // 男生
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_BOYS, self::CODE_TOP_SALE_BOYS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_BOYS);
break;
case 2: // 女生
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_GIRLS, self::CODE_TOP_SALE_GIRLS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_GIRLS);
break;
case 3: // 潮童
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_KIDS, self::CODE_TOP_SALE_KIDS);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_KIDS);
break;
case 4: // 创意生活
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT_LIFESTYLE, self::CODE_TOP_SALE_LIFESTYLE);
$result = self::cacheControl(CacheConfig::KEY_ACTION_PRODUCT_NEWSALE_DISCOUNT, self::CODE_TOP_SALE_LIFESTYLE);
break;
}
... ... @@ -174,8 +174,9 @@ class NewsaleModel
$result = array();
if (USE_CACHE) {
$key = $cacheKey . $codeKey;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($cacheKey, 'master');
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
... ... @@ -196,7 +197,7 @@ class NewsaleModel
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($cacheKey, 'slave');
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
... ...