|
@@ -27,6 +27,7 @@ class GradeModel |
|
@@ -27,6 +27,7 @@ class GradeModel |
27
|
}
|
27
|
}
|
28
|
//调用接口获取数据
|
28
|
//调用接口获取数据
|
29
|
$data = GradeData::getGradeData($channel, $uid);
|
29
|
$data = GradeData::getGradeData($channel, $uid);
|
|
|
30
|
+
|
30
|
if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
|
31
|
if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
|
31
|
switch (intval($data['data']['current_vip_level'])) {
|
32
|
switch (intval($data['data']['current_vip_level'])) {
|
32
|
case 0://普通会员
|
33
|
case 0://普通会员
|
|
@@ -42,19 +43,25 @@ class GradeModel |
|
@@ -42,19 +43,25 @@ class GradeModel |
42
|
$result['vipGrade']['vip3'] = true;
|
43
|
$result['vipGrade']['vip3'] = true;
|
43
|
break;
|
44
|
break;
|
44
|
}
|
45
|
}
|
|
|
46
|
+
|
45
|
//今年总消费
|
47
|
//今年总消费
|
46
|
$result['vipGrade']['costOfThisYear'] = $data['data']['current_year_cost'];
|
48
|
$result['vipGrade']['costOfThisYear'] = $data['data']['current_year_cost'];
|
47
|
//升级下一等级会员的进度;
|
49
|
//升级下一等级会员的进度;
|
48
|
- $result['vipGrade']['percent'] = 100*(round(round($data['data']['current_total_cost'], 2) / round($data['data']['next_need_cost'], 2), 2));
|
50
|
+ $result['vipGrade']['percent'] = 100*(round($data['data']['current_total_cost'] / $data['data']['next_need_cost'], 2));
|
49
|
//距离升级所需消费金额
|
51
|
//距离升级所需消费金额
|
|
|
52
|
+
|
50
|
if ($data['data']['current_vip_level'] != 3) {
|
53
|
if ($data['data']['current_vip_level'] != 3) {
|
51
|
$result['vipGrade']['costGap'] = $data['data']['upgrade_need_cost'];
|
54
|
$result['vipGrade']['costGap'] = $data['data']['upgrade_need_cost'];
|
52
|
}
|
55
|
}
|
53
|
//消费总计
|
56
|
//消费总计
|
54
|
$result['vipGrade']['sumCost'] = $data['data']['current_total_cost'];
|
57
|
$result['vipGrade']['sumCost'] = $data['data']['current_total_cost'];
|
55
|
- //username 接口问题取不到,暂时写uid
|
|
|
56
|
- $result['vipGrade']['name'] = $uid;
|
58
|
+ //username 调用获取用户基本信息数据,获得username;
|
|
|
59
|
+ $userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
|
|
|
60
|
+ $result['vipGrade']['name'] = $userProfile['data']['username'];
|
|
|
61
|
+ //跳转url(会员特权详情)
|
57
|
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential',null);
|
62
|
$result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential',null);
|
|
|
63
|
+ //当前vip等级享受的特权
|
|
|
64
|
+ $result['vipGrade']['privilege'] = $data['data']['enjoy_preferential'];
|
58
|
}
|
65
|
}
|
59
|
|
66
|
|
60
|
if (USE_CACHE) {
|
67
|
if (USE_CACHE) {
|