Authored by hf

modify guang detail page call api set timeout

@@ -42,7 +42,7 @@ class DetailData @@ -42,7 +42,7 @@ class DetailData
42 $key = CacheConfig::KEY_ACTION_GUANG_DETAIL_DATA . strval($id); 42 $key = CacheConfig::KEY_ACTION_GUANG_DETAIL_DATA . strval($id);
43 43
44 // 获取资讯 44 // 获取资讯
45 - $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType)); 45 + $article = Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PACKAGE_ARTICLE, 'getArticle', array($id, $clientType), false, 1000);
46 if (!isset($article['author_id'])) { 46 if (!isset($article['author_id'])) {
47 if (USE_CACHE) { 47 if (USE_CACHE) {
48 // 先尝试获取二级缓存(slave), 有数据则直接返回. 48 // 先尝试获取二级缓存(slave), 有数据则直接返回.
@@ -4,9 +4,10 @@ namespace LibModels\Wap\Guang; @@ -4,9 +4,10 @@ namespace LibModels\Wap\Guang;
4 4
5 use Api\Sign; 5 use Api\Sign;
6 use Api\Yohobuy; 6 use Api\Yohobuy;
7 -use Plugin\Helpers;  
8 use Configs\CacheConfig; 7 use Configs\CacheConfig;
  8 +use Plugin\Helpers;
9 use Plugin\Cache; 9 use Plugin\Cache;
  10 +use LibModels\Wap\Product\SearchData;
10 11
11 /** 12 /**
12 * 明星品牌和原创品牌相关的数据模型 13 * 明星品牌和原创品牌相关的数据模型
@@ -19,7 +20,6 @@ use Plugin\Cache; @@ -19,7 +20,6 @@ use Plugin\Cache;
19 */ 20 */
20 class PlusstarData 21 class PlusstarData
21 { 22 {
22 -  
23 const URI_BRANDLIST = 'guang/api/v1/plustar/getlist'; 23 const URI_BRANDLIST = 'guang/api/v1/plustar/getlist';
24 const URI_BRANDINFO_PLUSSTAR = 'guang/service/v1/plustar/'; 24 const URI_BRANDINFO_PLUSSTAR = 'guang/service/v1/plustar/';
25 const URI_BRANDINFO_FAVORITE = 'shops/service/v1/favorite/'; 25 const URI_BRANDINFO_FAVORITE = 'shops/service/v1/favorite/';
@@ -162,16 +162,24 @@ class PlusstarData @@ -162,16 +162,24 @@ class PlusstarData
162 $result['getUidProductFav'] = array(); 162 $result['getUidProductFav'] = array();
163 163
164 do { 164 do {
165 - // 调用搜索接口  
166 - $param = Yohobuy::param();  
167 - $param['method'] = 'app.search.li';  
168 - $param['brand'] = $brandInfo['data']['brand_id'];  
169 - $param['page'] = '0';  
170 - $param['limit'] = '6';  
171 - $param['gender'] = $gender;  
172 - $param['order'] = 's_t_desc';  
173 - $param['client_secret'] = Sign::getSign($param);  
174 - $newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟 165 +// // 调用搜索接口
  166 +// $param = Yohobuy::param();
  167 +// $param['method'] = 'app.search.li';
  168 +// $param['brand'] = $brandInfo['data']['brand_id'];
  169 +// $param['page'] = '0';
  170 +// $param['limit'] = '6';
  171 +// $param['gender'] = $gender;
  172 +// $param['order'] = 's_t_desc';
  173 +// $param['client_secret'] = Sign::getSign($param);
  174 +// $newProduct = Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟
  175 +
  176 + $condition = array();
  177 + $condition['brand'] = $brandInfo['data']['brand_id'];
  178 + $condition['gender'] = $gender;
  179 + $condition['limit'] = 6;
  180 + $condition['order'] = 's_t_desc';
  181 + $newProduct = SearchData::searchElasticByCondition($condition, 1800); // 有缓存30分钟
  182 +
175 if (empty($newProduct['data']['product_list'])) { 183 if (empty($newProduct['data']['product_list'])) {
176 break; 184 break;
177 } 185 }
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 use Action\AbstractAction; 3 use Action\AbstractAction;
4 use LibModels\Wap\Guang\PlusstarData; 4 use LibModels\Wap\Guang\PlusstarData;
5 use Plugin\Helpers; 5 use Plugin\Helpers;
6 -use Plugin\Cache;  
7 6
8 /** 7 /**
9 * 明星品牌和原创品牌 8 * 明星品牌和原创品牌