GradeData.php
1.78 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
53
54
55
56
57
58
59
<?php
namespace LibModels\Wap\Home;
use Api\Yohobuy;
use Api\Sign;
/*
* 个人中心-会员等级接口操作类
*/
class GradeData
{
/**
* 获取会员等级数据
* @param string $yh_channel 频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
* @param string $uid 用户id
* @return array 接口返回的会员等级数据
*/
public static function getGradeData($channel, $uid)
{
$urlList = array();
//获取会员等级数据
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param['uid'] = $uid;
$param['method'] = 'app.passport.vip';
$param['client_secret'] = Sign::getSign($param);
$urlList['grade'] = Yohobuy::httpBuildQuery(API_URL, $param);
//获取用户基本信息数据(用来得到username)
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
$urlList['userProfile'] = Yohobuy::httpBuildQuery(API_URL, $param);
return Yohobuy::getMulti($urlList);
}
/**
* 获取会员特权详情数据
* @param string $yh_channel 频道数据,1->男,2->女,3->潮童,4->创意生活,5->其他
* @param string $uid 用户id
* @return array 接口返回的会员特权详情数据
*/
public static function getPreferentialData($channel, $uid)
{
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param['uid'] = $uid;
$param['method'] = 'app.passport.getPrivilege';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(API_URL, $param);
}
}