Authored by hf

modify guang detail page call api set timeout

... ... @@ -42,7 +42,7 @@ class DetailData
$key = CacheConfig::KEY_ACTION_GUANG_DETAIL_DATA . strval($id);
// 获取资讯
$article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType));
$article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType), false, 1000);
if (!isset($article['author_id'])) {
if (USE_CACHE) {
// 先尝试获取二级缓存(slave), 有数据则直接返回.
... ...
... ... @@ -4,9 +4,10 @@ namespace LibModels\Wap\Guang;
use Api\Sign;
use Api\Yohobuy;
use Plugin\Helpers;
use Configs\CacheConfig;
use Plugin\Helpers;
use Plugin\Cache;
use LibModels\Wap\Product\SearchData;
/**
* 明星品牌和原创品牌相关的数据模型
... ... @@ -19,7 +20,6 @@ use Plugin\Cache;
*/
class PlusstarData
{
const URI_BRANDLIST = 'guang/api/v1/plustar/getlist';
const URI_BRANDINFO_PLUSSTAR = 'guang/service/v1/plustar/';
const URI_BRANDINFO_FAVORITE = 'shops/service/v1/favorite/';
... ... @@ -162,16 +162,24 @@ class PlusstarData
$result['getUidProductFav'] = array();
do {
// 调用搜索接口
$param = Yohobuy::param();
$param['method'] = 'app.search.li';
$param['brand'] = $brandInfo['data']['brand_id'];
$param['page'] = '0';
$param['limit'] = '6';
$param['gender'] = $gender;
$param['order'] = 's_t_desc';
$param['client_secret'] = Sign::getSign($param);
$newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
// // 调用搜索接口
// $param = Yohobuy::param();
// $param['method'] = 'app.search.li';
// $param['brand'] = $brandInfo['data']['brand_id'];
// $param['page'] = '0';
// $param['limit'] = '6';
// $param['gender'] = $gender;
// $param['order'] = 's_t_desc';
// $param['client_secret'] = Sign::getSign($param);
// $newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
$condition = array();
$condition['brand'] = $brandInfo['data']['brand_id'];
$condition['gender'] = $gender;
$condition['limit'] = 6;
$condition['order'] = 's_t_desc';
$newProduct = SearchData::searchElasticByCondition($condition, 1800); // 有缓存30分钟
if (empty($newProduct['data']['product_list'])) {
break;
}
... ...
... ... @@ -3,7 +3,6 @@
use Action\AbstractAction;
use LibModels\Wap\Guang\PlusstarData;
use Plugin\Helpers;
use Plugin\Cache;
/**
* 明星品牌和原创品牌
... ...