Authored by 郭成尧

'hot-product-api-change'

@@ -109,6 +109,31 @@ class SearchData @@ -109,6 +109,31 @@ class SearchData
109 } 109 }
110 110
111 /** 111 /**
  112 + * 通过 SKN 查询商品
  113 + * @param $condition
  114 + * @return mixed
  115 + */
  116 + public static function searchBySkn($condition)
  117 + {
  118 + $param = Yohobuy::param();
  119 + $param['method'] = 'h5.product.batch';
  120 + if (!isset($condition['order'])) {
  121 + $param['order'] = 's_t_desc';
  122 + }
  123 + if (!isset($condition['page'])) {
  124 + $param['page'] = 1;
  125 + }
  126 + if (!isset($condition['limit'])) {
  127 + $param['limit'] = 60;
  128 + }
  129 + if (!empty($condition)) {
  130 + $param += $condition;
  131 + }
  132 + $param['client_secret'] = Sign::getSign($param);
  133 + return Yohobuy::get(API_URL, $param);
  134 + }
  135 +
  136 + /**
112 * 根据给定查询数据搜索数据列表 (新的) 137 * 根据给定查询数据搜索数据列表 (新的)
113 * 138 *
114 * @param string $query 查询条件, 默认为null 139 * @param string $query 查询条件, 默认为null
@@ -305,7 +305,7 @@ class ShopProcess @@ -305,7 +305,7 @@ class ShopProcess
305 } 305 }
306 306
307 /* tar modified 160826 根据资源位接口返回的 skn 去查数据,查到后取商品数据,查不到取资源位接口数据 */ 307 /* tar modified 160826 根据资源位接口返回的 skn 去查数据,查到后取商品数据,查不到取资源位接口数据 */
308 - $hotProducts = SearchData::searchByCondition($condition); 308 + $hotProducts = SearchData::searchBySkn($condition);
309 309
310 if (isset($hotProducts['code']) && $hotProducts['code'] === 200 && isset($hotProducts['data']['product_list'])) { 310 if (isset($hotProducts['code']) && $hotProducts['code'] === 200 && isset($hotProducts['data']['product_list'])) {
311 foreach ($hotProducts['data']['product_list'] as $val) { 311 foreach ($hotProducts['data']['product_list'] as $val) {