Authored by yangyang

正在修改home-grade

framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -19,13 +19,27 @@ class GradeData
* @return array 接口返回的会员等级数据
*/
public 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);
return Yohobuy::get(Yohobuy::API_URL, $param);
$urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
//获取用户基本信息数据(用来得到username)
$param = array();
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['yh_channel'] = $channel;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
$urlList['userProfile'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL,$param);
return Yohobuy::getMulti($urlList);
//return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ... @@ -44,18 +58,18 @@ class GradeData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取用户基本信息数据
*/
public function getUserProfileData($gender, $uid, $channel) {
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['uid'] = $uid;
$param['yh_channel'] = $channel;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get("http://api.open.yohobuy.com/",$param);
}
// /**
// * 获取用户基本信息数据
// */
// public function getUserProfileData($gender, $uid, $channel) {
// $param = Yohobuy::param();
// $param['gender'] = $gender;
// $param['uid'] = $uid;
// $param['yh_channel'] = $channel;
// $param['method'] = 'app.passport.profile';
// $param['client_secret'] = Sign::getSign($param);
//
// return Yohobuy::get("http://api.open.yohobuy.com/",$param);
// }
}
... ...
... ... @@ -26,8 +26,8 @@ class GradeModel
}
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
$data = GradeData::getGradeData($gender,$channel, $uid);
print_r($data);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data'])) {
switch (intval($data['data']['current_vip_level'])) {
case 0://普通会员
... ...
... ... @@ -41,6 +41,7 @@ class BrandController extends AbstractAction
}
// 渲染模板
print_r(Category\BrandModel::getBrandByChannel($channel));
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
}
... ...