...
|
...
|
@@ -11,6 +11,7 @@ use LibModels\Web\Home\CartData; |
|
|
use WebPlugin\Cache;
|
|
|
use WebPlugin\Images;
|
|
|
use WebPlugin\Helpers;
|
|
|
use Api\Yohobuy;
|
|
|
|
|
|
class CommonController extends WebAction
|
|
|
{
|
...
|
...
|
@@ -239,27 +240,57 @@ class CommonController extends WebAction |
|
|
*/
|
|
|
public function passportAction()
|
|
|
{
|
|
|
// 是否调用个人信息数字接口
|
|
|
$getNumberFlag = true;
|
|
|
|
|
|
$userInfo = array();
|
|
|
$callback = $this->get('callback');
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
do {
|
|
|
|
|
|
if (empty($uid)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
//调用用户信息
|
|
|
// $userInfo = UserData::passportGet($uid);
|
|
|
|
|
|
//获取个人信息VIP资料
|
|
|
$api['profile'] = UserData::getUserProfile($uid, true);
|
|
|
$api['number'] = UserData::getUserInfoNum($uid, true);
|
|
|
$apiInfo = \Api\Yohobuy::getMulti($api);
|
|
|
if ($getNumberFlag) {
|
|
|
$api['number'] = UserData::getUserInfoNum($uid, true);
|
|
|
}
|
|
|
$apiInfo = Yohobuy::getMulti($api);
|
|
|
|
|
|
//个人信息调用失败返回
|
|
|
if (!isset($apiInfo['profile']) || empty($apiInfo['profile'])) {
|
|
|
break;
|
|
|
}
|
|
|
$userInfo['result'] = 1;
|
|
|
|
|
|
//个人资料
|
|
|
$userInfo['profileName'] = $apiInfo['profile']['profile_name'];
|
|
|
$userInfo['headIco'] = isset($apiInfo['profile']['head_ico']) && !empty($apiInfo['profile']['head_ico']) ? $apiInfo['profile']['head_ico'] : '';
|
|
|
//VIP信息
|
|
|
$userInfo['curLevel'] = $apiInfo['profile']['vip_info']['cur_level'];
|
|
|
$userInfo['curTitle'] = $apiInfo['profile']['vip_info']['title'];
|
|
|
$userInfo['curYearCost'] = isset($apiInfo['profile']['vip_info']['curYearCost']) ? $apiInfo['profile']['vip_info']['curYearCost'] : 0;
|
|
|
$userInfo['nextLevel'] = isset($apiInfo['profile']['vip_info']['next_level']) ? $apiInfo['profile']['vip_info']['next_level'] : 0;
|
|
|
$userInfo['nextVipTitle'] = isset($apiInfo['profile']['vip_info']['nextVipTitle']) ? $apiInfo['profile']['vip_info']['nextVipTitle'] : '';
|
|
|
$userInfo['nextVipNeedCost'] = isset($apiInfo['profile']['vip_info']['nextVipNeedCost']) ? $apiInfo['profile']['vip_info']['nextVipNeedCost'] : 0;
|
|
|
|
|
|
//升级百分比
|
|
|
if ($userInfo['nextVipNeedCost']) {
|
|
|
$userInfo['curYearCostPer'] = round($userInfo['curYearCost'] / $userInfo['nextVipNeedCost'] * 100);
|
|
|
}
|
|
|
|
|
|
$userInfo['data'] = array_merge($apiInfo['profile'], $apiInfo['number']);
|
|
|
$userInfo['data']['vip'] = $userInfo['data']['vip_info'];
|
|
|
unset($userInfo['data']['vip_info']);
|
|
|
$userInfo['data']['result'] = 1;
|
|
|
//待处理订单
|
|
|
$userInfo['order'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['wait_pay_num'] + $apiInfo['number']['wait_cargo_num'] + $apiInfo['number']['send_cargo_num'] : 0;
|
|
|
//我的收藏
|
|
|
$userInfo['favorite'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['brand_favorite_total'] : 0;
|
|
|
//我的优惠券
|
|
|
$userInfo['coupon'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['coupon_num'] : 0;
|
|
|
//我的YOHO币
|
|
|
$userInfo['coin'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['yoho_coin_num'] : 0;
|
|
|
//我的退换货
|
|
|
$userInfo['return'] = isset($apiInfo['number']) && !empty($apiInfo['number']) ? $apiInfo['number']['refund_exchange_num'] : 0;
|
|
|
|
|
|
//更新购物车cookie信息
|
|
|
$total = 0;
|
...
|
...
|
|