Authored by yangyang

正在修改home-grade

framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -19,13 +19,27 @@ class GradeData @@ -19,13 +19,27 @@ class GradeData
19 * @return array 接口返回的会员等级数据 19 * @return array 接口返回的会员等级数据
20 */ 20 */
21 public function getGradeData($channel, $uid) { 21 public function getGradeData($channel, $uid) {
22 - 22 + $urlList = array();
  23 + //获取会员等级数据
23 $param = Yohobuy::param(); 24 $param = Yohobuy::param();
24 $param['yh_channel'] = $channel; 25 $param['yh_channel'] = $channel;
25 $param['uid'] = $uid; 26 $param['uid'] = $uid;
26 $param['method'] = 'app.Passport.vip'; 27 $param['method'] = 'app.Passport.vip';
27 $param['client_secret'] = Sign::getSign($param); 28 $param['client_secret'] = Sign::getSign($param);
28 - return Yohobuy::get(Yohobuy::API_URL, $param); 29 + $urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
  30 +
  31 + //获取用户基本信息数据(用来得到username)
  32 + $param = array();
  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);
  42 + //return Yohobuy::get(Yohobuy::API_URL, $param);
29 } 43 }
30 44
31 /** 45 /**
@@ -44,18 +58,18 @@ class GradeData @@ -44,18 +58,18 @@ class GradeData
44 return Yohobuy::get(Yohobuy::API_URL, $param); 58 return Yohobuy::get(Yohobuy::API_URL, $param);
45 } 59 }
46 60
47 - /**  
48 - * 获取用户基本信息数据  
49 - */  
50 - public function getUserProfileData($gender, $uid, $channel) {  
51 - $param = Yohobuy::param();  
52 - $param['gender'] = $gender;  
53 - $param['uid'] = $uid;  
54 - $param['yh_channel'] = $channel;  
55 - $param['method'] = 'app.passport.profile';  
56 - $param['client_secret'] = Sign::getSign($param);  
57 -  
58 - return Yohobuy::get("http://api.open.yohobuy.com/",$param);  
59 - } 61 +// /**
  62 +// * 获取用户基本信息数据
  63 +// */
  64 +// public function getUserProfileData($gender, $uid, $channel) {
  65 +// $param = Yohobuy::param();
  66 +// $param['gender'] = $gender;
  67 +// $param['uid'] = $uid;
  68 +// $param['yh_channel'] = $channel;
  69 +// $param['method'] = 'app.passport.profile';
  70 +// $param['client_secret'] = Sign::getSign($param);
  71 +//
  72 +// return Yohobuy::get("http://api.open.yohobuy.com/",$param);
  73 +// }
60 74
61 } 75 }
@@ -26,8 +26,8 @@ class GradeModel @@ -26,8 +26,8 @@ class GradeModel
26 } 26 }
27 } 27 }
28 //调用接口获取数据 28 //调用接口获取数据
29 - $data = GradeData::getGradeData($channel, $uid);  
30 - 29 + $data = GradeData::getGradeData($gender,$channel, $uid);
  30 + print_r($data);
31 if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) { 31 if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
32 switch (intval($data['data']['current_vip_level'])) { 32 switch (intval($data['data']['current_vip_level'])) {
33 case 0://普通会员 33 case 0://普通会员
@@ -41,6 +41,7 @@ class BrandController extends AbstractAction @@ -41,6 +41,7 @@ class BrandController extends AbstractAction
41 } 41 }
42 42
43 // 渲染模板 43 // 渲染模板
  44 + print_r(Category\BrandModel::getBrandByChannel($channel));
44 $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel)); 45 $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
45 } 46 }
46 47