...
|
...
|
@@ -247,14 +247,13 @@ class HomeModel |
|
|
*/
|
|
|
public static function getNewArrival($channel)
|
|
|
{
|
|
|
$result = array();
|
|
|
$key = sprintf(WebCacheConfig::KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA.'_'.$channel);
|
|
|
$key = WebCacheConfig::KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA . '_' . $channel;
|
|
|
//缓存数据
|
|
|
$result = Cache::get($key);
|
|
|
if(empty($result)) {
|
|
|
if (empty($result)) {
|
|
|
$params = array(
|
|
|
'order' => 's_t_desc',
|
|
|
'shelve_time' => strtotime("-60 days") . ',' . time()
|
|
|
'order' => 's_t_desc',
|
|
|
'shelve_time' => strtotime("-60 days") . ',' . time()
|
|
|
);
|
|
|
//男首频道最新上架参数是gender=1,3
|
|
|
if($channel == self::COOKIE_NAME_BOYS) {
|
...
|
...
|
@@ -270,9 +269,13 @@ class HomeModel |
|
|
// 获取分类列表获取商品信息
|
|
|
$goodsList = SearchData::getSearchDataBySort($params, $sortList);
|
|
|
$pos = 1;
|
|
|
$val = array();
|
|
|
foreach ($goodsList as $goods) {
|
|
|
// 格式化数据
|
|
|
$val = Helpers::formatProduct($goods, true, true, true, 280, 373);
|
|
|
if (!$val) {
|
|
|
continue;
|
|
|
}
|
|
|
if ($val['price'] == false) {
|
|
|
$val['price'] = $val['salePrice'];
|
|
|
}
|
...
|
...
|
@@ -287,13 +290,16 @@ class HomeModel |
|
|
$val['tags']['isReNew'] = false;//$val['tags']['is_advance'];暂时不显示
|
|
|
unset($val['tags']['is_advance'], $val['tags']['is_discount'], $val['tags']['is_limited'], $val['tags']['is_new'],
|
|
|
$val['tags']['is_yohood'], $val['tags']['midYear'], $val['tags']['yearEnd']);
|
|
|
if (! empty($val)) {
|
|
|
$result[] = $val;
|
|
|
}
|
|
|
$result[] = $val;
|
|
|
}
|
|
|
}
|
|
|
Cache::set($key, $result, 3600);
|
|
|
}
|
|
|
// 当一级缓存失效,并且接口异常时, 尝试从二级缓存获取数据
|
|
|
if (empty($result)) {
|
|
|
$result = Cache::get($key, 'slave');
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|