Authored by yangyang

修改了grade相关

... ... @@ -27,7 +27,7 @@ class Yohobuy
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL_MYCENTER = 'http://192.168.102.213:8080/yoho-users-web/'; // 我的个人中心接口URL
const API_URL_MYCENTER = 'http://192.168.102.213:8081/yoho-users-web/'; // 我的个人中心接口URL
const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
const API_URL_PRODUCTDETAIL = 'http://172.16.6.145:8080/'; // 商品详情页
... ... @@ -415,6 +415,7 @@ class Yohobuy
*/
public static function jsonPost($url, $data = array(), $returnJson = false, $timeout = 5, $cookie = array())
{
echo $url;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
... ... @@ -447,7 +448,6 @@ class Yohobuy
}
curl_close($ch);
$data = array();
return $result;
}
... ...
... ... @@ -19,26 +19,12 @@ class GradeData
* @param string $uid 用户id
* @return array 接口返回的会员等级数据
*/
public static function getGradeData($gender, $channel, $uid) {
$urlList = array();
public static function getGradeData($uid) {
//获取会员等级数据
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param = array();
$param['uid'] = $uid;
$param['method'] = 'app.Passport.vip';
$param['client_secret'] = Sign::getSign($param);
$urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
//获取用户基本信息数据(用来得到username)
$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);
var_dump($param);
var_dump(Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER.'UserVipRest/getVipDetailInfo', $param));
}
/**
... ...
<?php
use Action\AbstractAction;
use home\GradeModel;
use home\OrderModel;
use Home\GradeModel;
use Home\OrderModel;
use Plugin\Helpers;
use LibModels\Wap\Home\OrderData;
... ... @@ -453,12 +453,9 @@ class HomeController extends AbstractAction
$this->setTitle('会员等级');
//显示网站导航头部信息
$this->setNavHeader('会员等级');
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$uid = $this->getUid();
$uid = '10267443'; //临时测试用
$data = GradeModel::getGrade($gender, $channel, $uid);
$uid = '8826435'; //临时测试用
$data = GradeModel::getGrade($uid);
$data['pageFooter'] = true;
$this->_view->display('vip-grade', $data);
}
... ...
... ... @@ -14,7 +14,7 @@ class GradeModel
* 获取个人中心-会员等级数据
*/
public static function getGrade($gender, $channel, $uid)
public static function getGrade($uid)
{
$result = array();
... ... @@ -26,8 +26,8 @@ class GradeModel
}
}
//调用接口获取数据
$data = GradeData::getGradeData($gender, $channel, $uid);
$data = GradeData::getGradeData($uid);
print_r($data);
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
... ...