...
|
...
|
@@ -16,6 +16,7 @@ use Api\Sign; |
|
|
*/
|
|
|
class BrandData
|
|
|
{
|
|
|
|
|
|
const URI_BRAND_TOPPOS = 'operations/api/v5/resource/get';
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -32,13 +33,13 @@ class BrandData |
|
|
public static function package($contentCode, $channel)
|
|
|
{
|
|
|
$urlList = array();
|
|
|
|
|
|
|
|
|
/* 顶部的轮翻广告及热门品牌数据 */
|
|
|
$param = Yohobuy::param();
|
|
|
$param['content_code'] = $contentCode;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param);
|
|
|
|
|
|
|
|
|
/* 按字母"A-Z"分组的品牌列表数据 */
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.brand.brandlist';
|
...
|
...
|
@@ -48,7 +49,7 @@ class BrandData |
|
|
|
|
|
return Yohobuy::getMulti($urlList);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取品牌数据
|
|
|
*
|
...
|
...
|
@@ -98,7 +99,7 @@ class BrandData |
|
|
$param['uid'] = $uid;
|
|
|
$param['method'] = 'app.brand.getBrandIntro';
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
|
|
|
$cache = empty($uid) ? 3600 : false;
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 有缓存1小时
|
...
|
...
|
@@ -165,8 +166,8 @@ class BrandData |
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
|
|
|
/**
|
|
|
* 查询商品数据
|
|
|
*
|
|
|
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
|
...
|
...
|
@@ -182,15 +183,21 @@ class BrandData |
|
|
* @param integer $channel 表示频道号,1位男生,2为女生
|
|
|
* @return array 品类商品数据
|
|
|
*/
|
|
|
public static function filterBrandData($condition, $order = 's_t_desc', $limit = 60, $page = 1)
|
|
|
public static function filterBrandData($condition)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.search.brand';
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['order'] = $order;
|
|
|
$param += $condition;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
if (!isset($param['order'])) {
|
|
|
$param['order'] = 's_t_desc';
|
|
|
}
|
|
|
if (!isset($param['limit'])) {
|
|
|
$param['limit'] = 60;
|
|
|
}
|
|
|
if (!isset($param['page'])) {
|
|
|
$param['page'] = 1;
|
|
|
}
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::API_URL, $param);
|
|
|
}
|
...
|
...
|
|