...
|
...
|
@@ -15,57 +15,54 @@ use Api\Sign; |
|
|
*/
|
|
|
class NewsaleData
|
|
|
{
|
|
|
const URI_NEWSALE_TOPPOS = 'operations/api/v5/resource/get';
|
|
|
|
|
|
/**
|
|
|
* 获取新品到着,折扣专区焦点图数据
|
|
|
* @param string $contentCode 内容位置码
|
|
|
* @return array 新品到着焦点图有关数据
|
|
|
*/
|
|
|
public static function getNewsaleFocus($contentCode)
|
|
|
{
|
|
|
// 构建必传参数
|
|
|
$param = Yohobuy::param();
|
|
|
|
|
|
$param['content_code'] = $contentCode;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/resource/get', $param);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取新品到着商品数据
|
|
|
* 封装新品到着、折扣专区页面的顶部焦点图和下部商品的数据
|
|
|
*
|
|
|
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
|
|
|
* @param string $channel 1表示男, 2表示女
|
|
|
* @param integer $limit 查询返回的最大限制数, 默认为50
|
|
|
* @param integer $page 分页第几页, 默认第1页
|
|
|
* @return array 新品到着商品数据
|
|
|
* @param string $contentCode 获取广告资源需要的位置码
|
|
|
* @param string $gender 1,3表示男, 2,3表示女,1,2,3表示全部
|
|
|
* @param integer $channel 频道标识 1:男,2:女,3:潮童,4:创意生活
|
|
|
* @param integer $limit 查询返回的最大限制数, 默认为50
|
|
|
* @param integer $page 分页第几页, 默认第1页
|
|
|
* @return array(
|
|
|
* "newsaleTop": "顶部的轮翻广告数据",
|
|
|
* "newsaleList": "产品列表数据"
|
|
|
* )
|
|
|
* @author gtskk <rocky.zhang@yoho.cn>
|
|
|
*/
|
|
|
public static function getNewProducts($gender, $channel, $limit = 50, $page = 1)
|
|
|
public static function package($contentCode, $gender, $channel, $limit = 50, $page = 1)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.search.newProduct';
|
|
|
$param['gender'] = $gender;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['yh_channel'] = $channel;
|
|
|
|
|
|
// 构建url地址列表
|
|
|
$urlList = array();
|
|
|
$param['dayLimit'] = 1;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['new'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
$param['dayLimit'] = 2;
|
|
|
unset($param['client_secret']);
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['week'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
$param['dayLimit'] = 3;
|
|
|
unset($param['client_secret']);
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['sale'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
//var_dump($urlList);exit;
|
|
|
|
|
|
return Yohobuy::getMulti($urlList);
|
|
|
$urlList = array();
|
|
|
|
|
|
/* 顶部的轮翻广告数据 */
|
|
|
$param = Yohobuy::param();
|
|
|
$param['content_code'] = $contentCode;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['newsaleTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_NEWSALE_TOPPOS, $param);
|
|
|
|
|
|
/* 产品列表数据 */
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.search.newProduct';
|
|
|
$param['gender'] = $gender;
|
|
|
$param['page'] = $page;
|
|
|
$param['limit'] = $limit;
|
|
|
$param['yh_channel'] = $channel;
|
|
|
|
|
|
// 构建url地址列表
|
|
|
$param['dayLimit'] = 1;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['new'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
$param['dayLimit'] = 2;
|
|
|
unset($param['client_secret']);
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['week'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
$param['dayLimit'] = 3;
|
|
|
unset($param['client_secret']);
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
$urlList['sale'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
|
|
|
|
|
|
return Yohobuy::getMulti($urlList);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|