...
|
...
|
@@ -5,6 +5,7 @@ namespace LibModels\Wap\Guang; |
|
|
use Api\Sign;
|
|
|
use Api\Yohobuy;
|
|
|
use Plugin\Helpers;
|
|
|
use Configs\CacheConfig;
|
|
|
|
|
|
/**
|
|
|
* 明星品牌和原创品牌相关的数据模型
|
...
|
...
|
@@ -124,9 +125,18 @@ class PlusstarData |
|
|
$result['getUidProductFav'] = array();
|
|
|
$result['getArticleByBrand'] = array();
|
|
|
|
|
|
$key = CacheConfig::KEY_ACTION_GUANG_PLUSTAR_DATA . strval($id);
|
|
|
|
|
|
// 品牌详情信息
|
|
|
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_BRANDINFO_PLUSSTAR, 'getBrandInfo', array(array('id' => $id)), 3600); // 缓存1小时
|
|
|
if (!isset($brandInfo['data']['brand_id'])) {
|
|
|
if (USE_CACHE) {
|
|
|
// 先尝试获取二级缓存(slave), 有数据则直接返回.
|
|
|
$result = Cache::get($key, 'slave');
|
|
|
if (!empty($result)) {
|
|
|
return $result;
|
|
|
}
|
|
|
}
|
|
|
return $result;
|
|
|
} else {
|
|
|
$result['getBrandInfo'] = $brandInfo;
|
...
|
...
|
@@ -196,10 +206,12 @@ class PlusstarData |
|
|
// 调用发起请求
|
|
|
Yohobuy::yarConcurrentLoop();
|
|
|
|
|
|
return $result;
|
|
|
if (USE_CACHE && !empty($result['getBrandInfo'])) {
|
|
|
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
|
|
|
Cache::set($key, $result);
|
|
|
}
|
|
|
|
|
|
// $goods_url = MakeUrl::h5ProductDetailUrl($baseUrl,$new_goods_info['product_id'],$new_goods_info['goods_list'][0]['goods_id'],$new_goods_info['cn_alphabet']);
|
|
|
// $url = MakeUrl::makeUrl('go.productDetail',$goods_url, array('product_skn'=>$new_goods_info['product_skn']),$client_type);
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|