BrandData.php
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace LibModels\Wap\Category;
use Api\Yohobuy;
use Api\Sign;
/**
* 品牌数据接口操作类
*
* @name BrandData
* @package Library/LibModels/wap/Category
* @copyright yoho.inc
* @version 1.0 (2015-10-10)
* @author gtskk <rocky.zhang@yoho.cn>
*/
class BrandData
{
/**
* 获取品牌数据
*
* @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据
*
* @return array 品牌数据
*/
public static function getBrandsData($channel = 1)
{
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.brand.brandlist';
$param['yh_channel'] = $channel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取品牌页顶部楼层数据
*
* @return array 品牌也顶部楼层数据
*/
public static function getBrandTopData()
{
// 构建必传参数
$param = Yohobuy::param();
$param['content_code'] = 'ce6ac059493ec26241a8cbe0bfa1b17a';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/resource/get', $param);
}
}