Showing
4 changed files
with
13 additions
and
30 deletions
@@ -27,7 +27,7 @@ class Yohobuy | @@ -27,7 +27,7 @@ class Yohobuy | ||
27 | const API_URL = 'http://test2.open.yohobuy.com/'; | 27 | const API_URL = 'http://test2.open.yohobuy.com/'; |
28 | const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; | 28 | const SERVICE_URL = 'http://test.service.api.yohobuy.com/'; |
29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
30 | - const API_URL_MYCENTER = 'http://192.168.102.213:8080/yoho-users-web/'; // 我的个人中心接口URL | 30 | + const API_URL_MYCENTER = 'http://192.168.102.213:8081/yoho-users-web/'; // 我的个人中心接口URL |
31 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL | 31 | const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL |
32 | const API_URL_PRODUCTDETAIL = 'http://172.16.6.145:8080/'; // 商品详情页 | 32 | const API_URL_PRODUCTDETAIL = 'http://172.16.6.145:8080/'; // 商品详情页 |
33 | 33 | ||
@@ -415,6 +415,7 @@ class Yohobuy | @@ -415,6 +415,7 @@ class Yohobuy | ||
415 | */ | 415 | */ |
416 | public static function jsonPost($url, $data = array(), $returnJson = false, $timeout = 5, $cookie = array()) | 416 | public static function jsonPost($url, $data = array(), $returnJson = false, $timeout = 5, $cookie = array()) |
417 | { | 417 | { |
418 | + echo $url; | ||
418 | $ch = curl_init($url); | 419 | $ch = curl_init($url); |
419 | 420 | ||
420 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); | 421 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
@@ -447,7 +448,6 @@ class Yohobuy | @@ -447,7 +448,6 @@ class Yohobuy | ||
447 | } | 448 | } |
448 | curl_close($ch); | 449 | curl_close($ch); |
449 | $data = array(); | 450 | $data = array(); |
450 | - | ||
451 | return $result; | 451 | return $result; |
452 | } | 452 | } |
453 | 453 |
@@ -19,26 +19,12 @@ class GradeData | @@ -19,26 +19,12 @@ class GradeData | ||
19 | * @param string $uid 用户id | 19 | * @param string $uid 用户id |
20 | * @return array 接口返回的会员等级数据 | 20 | * @return array 接口返回的会员等级数据 |
21 | */ | 21 | */ |
22 | - public static function getGradeData($gender, $channel, $uid) { | ||
23 | - $urlList = array(); | 22 | + public static function getGradeData($uid) { |
24 | //获取会员等级数据 | 23 | //获取会员等级数据 |
25 | - $param = Yohobuy::param(); | ||
26 | - $param['yh_channel'] = $channel; | 24 | + $param = array(); |
27 | $param['uid'] = $uid; | 25 | $param['uid'] = $uid; |
28 | - $param['method'] = 'app.Passport.vip'; | ||
29 | - $param['client_secret'] = Sign::getSign($param); | ||
30 | - $urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); | ||
31 | - | ||
32 | - //获取用户基本信息数据(用来得到username) | ||
33 | - $param = Yohobuy::param(); | ||
34 | - $param['gender'] = $gender; | ||
35 | - $param['uid'] = $uid; | ||
36 | - $param['yh_channel'] = $channel; | ||
37 | - $param['method'] = 'app.passport.profile'; | ||
38 | - $param['client_secret'] = Sign::getSign($param); | ||
39 | - $urlList['userProfile'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); | ||
40 | - | ||
41 | - return Yohobuy::getMulti($urlList); | 26 | + var_dump($param); |
27 | + var_dump(Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER.'UserVipRest/getVipDetailInfo', $param)); | ||
42 | } | 28 | } |
43 | 29 | ||
44 | /** | 30 | /** |
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
4 | -use home\GradeModel; | ||
5 | -use home\OrderModel; | 4 | +use Home\GradeModel; |
5 | +use Home\OrderModel; | ||
6 | use Plugin\Helpers; | 6 | use Plugin\Helpers; |
7 | use LibModels\Wap\Home\OrderData; | 7 | use LibModels\Wap\Home\OrderData; |
8 | 8 | ||
@@ -453,12 +453,9 @@ class HomeController extends AbstractAction | @@ -453,12 +453,9 @@ class HomeController extends AbstractAction | ||
453 | $this->setTitle('会员等级'); | 453 | $this->setTitle('会员等级'); |
454 | //显示网站导航头部信息 | 454 | //显示网站导航头部信息 |
455 | $this->setNavHeader('会员等级'); | 455 | $this->setNavHeader('会员等级'); |
456 | - | ||
457 | - $gender = Helpers::getGenderByCookie(); | ||
458 | - $channel = Helpers::getChannelByCookie(); | ||
459 | $uid = $this->getUid(); | 456 | $uid = $this->getUid(); |
460 | - $uid = '10267443'; //临时测试用 | ||
461 | - $data = GradeModel::getGrade($gender, $channel, $uid); | 457 | + $uid = '8826435'; //临时测试用 |
458 | + $data = GradeModel::getGrade($uid); | ||
462 | $data['pageFooter'] = true; | 459 | $data['pageFooter'] = true; |
463 | $this->_view->display('vip-grade', $data); | 460 | $this->_view->display('vip-grade', $data); |
464 | } | 461 | } |
@@ -14,7 +14,7 @@ class GradeModel | @@ -14,7 +14,7 @@ class GradeModel | ||
14 | * 获取个人中心-会员等级数据 | 14 | * 获取个人中心-会员等级数据 |
15 | */ | 15 | */ |
16 | 16 | ||
17 | - public static function getGrade($gender, $channel, $uid) | 17 | + public static function getGrade($uid) |
18 | { | 18 | { |
19 | $result = array(); | 19 | $result = array(); |
20 | 20 | ||
@@ -26,8 +26,8 @@ class GradeModel | @@ -26,8 +26,8 @@ class GradeModel | ||
26 | } | 26 | } |
27 | } | 27 | } |
28 | //调用接口获取数据 | 28 | //调用接口获取数据 |
29 | - $data = GradeData::getGradeData($gender, $channel, $uid); | ||
30 | - | 29 | + $data = GradeData::getGradeData($uid); |
30 | + print_r($data); | ||
31 | if (!empty($data['grade'])) { | 31 | if (!empty($data['grade'])) { |
32 | switch (intval($data['grade']['current_vip_level'])) { | 32 | switch (intval($data['grade']['current_vip_level'])) { |
33 | case 0://普通会员 | 33 | case 0://普通会员 |
-
Please register or login to post a comment