Authored by whb

web缓存字段

<?php
namespace Configs;
/**
* 缓存配置文件
*/
class WebCacheConfig
{
const KEY_WEB_HOME_NAVBAR_DATA = 'key_web_home_navbar_data';//web的导航数据
const KEY_WEB_HOME_CHANNEL_DATA = 'key_web_home_channel_data';//web首页频道数据[boys, girls, kids, lifestyle]
const KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA = 'key_web_home_newarrival_data';//web频道最新上架数据[boys, girls, kids, lifestyle]
const KEY_WEB_PRODUCT_SEARCH_DATA = 'key_web_product_search_data'; // web搜索的数据
}
<?php
namespace Configs;
/**
* 缓存配置文件
*/
class WebCacheConfig
{
const KEY_WEB_INDEX_BRANDS_LIST_DATA = 'key_web_index_brands_list_data';//频道brands数据
const KEY_WEB_HOME_NAVBAR_DATA = 'key_web_home_navbar_data';//web的导航数据
const KEY_WEB_HOME_CHANNEL_DATA = 'key_web_home_channel_data';//web首页频道数据[boys, girls, kids, lifestyle]
const KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA = 'key_web_home_newarrival_data';//web频道最新上架数据[boys, girls, kids, lifestyle]
const KEY_WEB_PRODUCT_SEARCH_DATA = 'key_web_product_search_data'; // web搜索的数据
}
... ...
... ... @@ -4,7 +4,7 @@ namespace WebPlugin\DataProcess;
use WebPlugin\Images;
use WebPlugin\Helpers;
use WebPlugin\Cache;
use Configs\CacheConfig;
use Configs\WebCacheConfig;
use LibModels\Web\Product\SearchData;
/**
... ... @@ -488,7 +488,7 @@ class Process
unset($data[$key + 3]);
}
$type_key = sprintf("%s_%s", $type, $key + 2);
$cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $type_key);
Cache::set($cacheKey, $floor, 86400);
$result['preferenceBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
unset($data[$key], $data[$key + 1], $data[$key + 2]);
... ... @@ -869,7 +869,7 @@ class Process
}
$floor['moreBrand'] = 'http://yohobuy.com/brands';
$type_key = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $type_key);
Cache::set($cacheKey, $floor, 86400);
$result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
}
... ...
... ... @@ -3,7 +3,7 @@ use Action\WebAction;
use Index\HomeModel;
use LibModels\Web\Home\IndexData;
use WebPlugin\Cache;
use Configs\CacheConfig;
use Configs\WebCacheConfig;
use Api\Yohobuy;
use WebPlugin\Images;
use WebPlugin\Helpers;
... ... @@ -20,7 +20,7 @@ class CommonController extends WebAction
$type = $this->get('type');
$data = array();
if (! empty($type)) {
$key = CacheConfig::KEY_INDEX_BRANDS_LIST_DATA . '_' . $type;
$key = WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA . '_' . $type;
// array('logoBrand'=>'','moreBrand'=>'')
$data = Cache::get($key);
}
... ...
... ... @@ -2,7 +2,6 @@
namespace Index;
use Configs\WebCacheConfig;
use Configs\ChannelConfig;
use WebPlugin\Helpers;
use WebPlugin\Cache;
use LibModels\Web\Home\IndexData;
... ...