Authored by 郭成尧

'hot-product-api-change'

... ... @@ -109,6 +109,31 @@ class SearchData
}
/**
* 通过 SKN 查询商品
* @param $condition
* @return mixed
*/
public static function searchBySkn($condition)
{
$param = Yohobuy::param();
$param['method'] = 'h5.product.batch';
if (!isset($condition['order'])) {
$param['order'] = 's_t_desc';
}
if (!isset($condition['page'])) {
$param['page'] = 1;
}
if (!isset($condition['limit'])) {
$param['limit'] = 60;
}
if (!empty($condition)) {
$param += $condition;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
/**
* 根据给定查询数据搜索数据列表 (新的)
*
* @param string $query 查询条件, 默认为null
... ...
... ... @@ -305,7 +305,7 @@ class ShopProcess
}
/* tar modified 160826 根据资源位接口返回的 skn 去查数据,查到后取商品数据,查不到取资源位接口数据 */
$hotProducts = SearchData::searchByCondition($condition);
$hotProducts = SearchData::searchBySkn($condition);
if (isset($hotProducts['code']) && $hotProducts['code'] === 200 && isset($hotProducts['data']['product_list'])) {
foreach ($hotProducts['data']['product_list'] as $val) {
... ...