...
|
...
|
@@ -63,6 +63,9 @@ class HomeModel |
|
|
return array();
|
|
|
}
|
|
|
$menu = array();
|
|
|
$key = sprintf('%s_%s_%s',CacheConfig::KEY_WEB_HOME_NAVBAR_DATA, md5(serialize($data)), $channel);
|
|
|
$menu = Cache::get($key);
|
|
|
if(empty($menu)) {
|
|
|
$item = array();
|
|
|
foreach ($data['data'] as $val) {
|
|
|
$item = array(
|
...
|
...
|
@@ -112,6 +115,8 @@ class HomeModel |
|
|
}
|
|
|
$menu[] = $item;
|
|
|
}
|
|
|
Cache::set($key, $menu, 3600);
|
|
|
}
|
|
|
return $menu;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -165,9 +170,14 @@ class HomeModel |
|
|
*/
|
|
|
public static function getChannelResource($channel, $content_code)
|
|
|
{
|
|
|
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_'.$channel);
|
|
|
$data = Cache::get($key);
|
|
|
if(empty($data)) {
|
|
|
$resource = IndexData::getResourceData($content_code);
|
|
|
// 格式化数据
|
|
|
$data = ChannelProcess::getFormat($channel, $resource['data']);
|
|
|
Cache::set($key, $data, 3600);
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -213,6 +223,10 @@ class HomeModel |
|
|
public static function getNewArrival($channel)
|
|
|
{
|
|
|
$result = array();
|
|
|
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA.'_'.$channel);
|
|
|
//缓存数据
|
|
|
$result = Cache::get($key);
|
|
|
if(empty($result)) {
|
|
|
$params = array(
|
|
|
'order' => 's_t_desc',
|
|
|
'shelve_time' => strtotime("-60 days") . ',' . time()
|
...
|
...
|
@@ -253,6 +267,8 @@ class HomeModel |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Cache::set($key, $result, 3600);
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|