...
|
...
|
@@ -29,7 +29,7 @@ class SideModel |
|
|
|
|
|
if (USE_CACHE) {
|
|
|
// 先尝试获取一级缓存(master), 有数据则直接返回.
|
|
|
$result = Cache::get(CacheConfig::KEY_COMMON_SIDE_NAV, 'master');
|
|
|
$result = Cache::get(CacheConfig::KEY_COMMON_SIDE_NAV.'_'.$guangChoosed, 'master');
|
|
|
if (!empty($result)) {
|
|
|
// $result[] = self::genLeftNavGuang($guangChoosed);
|
|
|
return $result;
|
...
|
...
|
@@ -88,11 +88,11 @@ class SideModel |
|
|
if (USE_CACHE) {
|
|
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
|
|
if (empty($result)) {
|
|
|
$result = Cache::get(CacheConfig::KEY_COMMON_SIDE_NAV, 'slave');
|
|
|
$result = Cache::get(CacheConfig::KEY_COMMON_SIDE_NAV.'_'.$guangChoosed, 'slave');
|
|
|
}
|
|
|
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
|
|
|
else {
|
|
|
Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV, $result);
|
|
|
Cache::set(CacheConfig::KEY_COMMON_SIDE_NAV.'_'.$guangChoosed, $result);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|