...
|
...
|
@@ -239,12 +239,30 @@ class CommonController extends WebAction |
|
|
*/
|
|
|
public function passportAction()
|
|
|
{
|
|
|
$userInfo = array();
|
|
|
$callback = $this->get('callback');
|
|
|
$uid = $this->getUid();
|
|
|
$userInfo = UserData::passportGet($uid);
|
|
|
if (!empty($uid)) {
|
|
|
$total = 0;
|
|
|
|
|
|
do {
|
|
|
|
|
|
if (empty($uid)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
//调用用户信息
|
|
|
// $userInfo = UserData::passportGet($uid);
|
|
|
|
|
|
$api['profile'] = UserData::getUserProfile($uid, true);
|
|
|
$api['number'] = UserData::getUserInfoNum($uid, true);
|
|
|
$apiInfo = \Api\Yohobuy::getMulti($api);
|
|
|
|
|
|
$userInfo['data'] = array_merge($apiInfo['profile'], $apiInfo['number']);
|
|
|
$userInfo['data']['vip'] = $userInfo['data']['vip_info'];
|
|
|
unset($userInfo['data']['vip_info']);
|
|
|
$userInfo['data']['result'] = 1;
|
|
|
|
|
|
//更新购物车cookie信息
|
|
|
$total = 0;
|
|
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
|
|
$result = CartModel::shoppingCart($uid, $shoppingKey);
|
|
|
if (isset($result['main_goods'])) {
|
...
|
...
|
@@ -259,25 +277,15 @@ class CommonController extends WebAction |
|
|
'_r' => 1
|
|
|
)));
|
|
|
}
|
|
|
}
|
|
|
if (isset($userInfo['data'])) {
|
|
|
if (isset($userInfo['data']['data']['vip']['curYearCost'])) {
|
|
|
$userInfo['data']['data']['vip']['curYearCost'] = intval($userInfo['data']['data']['vip']['curYearCost']);
|
|
|
}
|
|
|
if (isset($userInfo['data']['data']['vip']['nextVipInfo']['needCost'])) {
|
|
|
$userInfo['data']['data']['vip']['nextVipInfo']['needCost'] = intval($userInfo['data']['data']['vip']['nextVipInfo']['needCost']);
|
|
|
}
|
|
|
if (isset($userInfo['data']['data']['head_ico']) && !empty($userInfo['data']['data']['head_ico'])) {
|
|
|
$userInfo['data']['data']['head_ico'] = Images::getImageUrl($userInfo['data']['data']['head_ico'], 63, 63, 2, 'yhb-head');
|
|
|
}
|
|
|
if (isset($userInfo['data']['data']['vip']['curYearCostPer'])) {
|
|
|
$userInfo['data']['data']['vip']['curYearCostPer'] = intval($userInfo['data']['data']['vip']['curYearCostPer']);
|
|
|
}
|
|
|
$userInfo['data']['result'] = 1;
|
|
|
$this->helpJsonCallbackResult($callback, 200,'User info', $userInfo['data']);
|
|
|
} else {
|
|
|
|
|
|
} while(false);
|
|
|
|
|
|
if (empty($userInfo)) {
|
|
|
$this->helpJsonCallbackResult($callback, 403,'User info', '');
|
|
|
} else {
|
|
|
$this->helpJsonCallbackResult($callback, 200,'User info', $userInfo);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -298,7 +306,6 @@ class CommonController extends WebAction |
|
|
$sknArray = explode('-', $val);
|
|
|
$skn[]= $sknArray[0];
|
|
|
}
|
|
|
// rsort($skn);
|
|
|
$skn = array_slice($skn, 0 ,$limit);
|
|
|
$result = SearchModel::historyProduct($skn, $limit);
|
|
|
} while(false);
|
...
|
...
|
|