|
@@ -239,12 +239,30 @@ class CommonController extends WebAction |
|
@@ -239,12 +239,30 @@ class CommonController extends WebAction |
239
|
*/
|
239
|
*/
|
240
|
public function passportAction()
|
240
|
public function passportAction()
|
241
|
{
|
241
|
{
|
|
|
242
|
+ $userInfo = array();
|
242
|
$callback = $this->get('callback');
|
243
|
$callback = $this->get('callback');
|
243
|
$uid = $this->getUid();
|
244
|
$uid = $this->getUid();
|
244
|
- $userInfo = UserData::passportGet($uid);
|
|
|
245
|
- if (!empty($uid)) {
|
|
|
246
|
- $total = 0;
|
245
|
+
|
|
|
246
|
+ do {
|
|
|
247
|
+
|
|
|
248
|
+ if (empty($uid)) {
|
|
|
249
|
+ break;
|
|
|
250
|
+ }
|
|
|
251
|
+
|
|
|
252
|
+ //调用用户信息
|
|
|
253
|
+// $userInfo = UserData::passportGet($uid);
|
|
|
254
|
+
|
|
|
255
|
+ $api['profile'] = UserData::getUserProfile($uid, true);
|
|
|
256
|
+ $api['number'] = UserData::getUserInfoNum($uid, true);
|
|
|
257
|
+ $apiInfo = \Api\Yohobuy::getMulti($api);
|
|
|
258
|
+
|
|
|
259
|
+ $userInfo['data'] = array_merge($apiInfo['profile'], $apiInfo['number']);
|
|
|
260
|
+ $userInfo['data']['vip'] = $userInfo['data']['vip_info'];
|
|
|
261
|
+ unset($userInfo['data']['vip_info']);
|
|
|
262
|
+ $userInfo['data']['result'] = 1;
|
|
|
263
|
+
|
247
|
//更新购物车cookie信息
|
264
|
//更新购物车cookie信息
|
|
|
265
|
+ $total = 0;
|
248
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
266
|
$shoppingKey = Helpers::getShoppingKeyByCookie();
|
249
|
$result = CartModel::shoppingCart($uid, $shoppingKey);
|
267
|
$result = CartModel::shoppingCart($uid, $shoppingKey);
|
250
|
if (isset($result['main_goods'])) {
|
268
|
if (isset($result['main_goods'])) {
|
|
@@ -259,25 +277,15 @@ class CommonController extends WebAction |
|
@@ -259,25 +277,15 @@ class CommonController extends WebAction |
259
|
'_r' => 1
|
277
|
'_r' => 1
|
260
|
)));
|
278
|
)));
|
261
|
}
|
279
|
}
|
262
|
- }
|
|
|
263
|
- if (isset($userInfo['data'])) {
|
|
|
264
|
- if (isset($userInfo['data']['data']['vip']['curYearCost'])) {
|
|
|
265
|
- $userInfo['data']['data']['vip']['curYearCost'] = intval($userInfo['data']['data']['vip']['curYearCost']);
|
|
|
266
|
- }
|
|
|
267
|
- if (isset($userInfo['data']['data']['vip']['nextVipInfo']['needCost'])) {
|
|
|
268
|
- $userInfo['data']['data']['vip']['nextVipInfo']['needCost'] = intval($userInfo['data']['data']['vip']['nextVipInfo']['needCost']);
|
|
|
269
|
- }
|
|
|
270
|
- if (isset($userInfo['data']['data']['head_ico']) && !empty($userInfo['data']['data']['head_ico'])) {
|
|
|
271
|
- $userInfo['data']['data']['head_ico'] = Images::getImageUrl($userInfo['data']['data']['head_ico'], 63, 63, 2, 'yhb-head');
|
|
|
272
|
- }
|
|
|
273
|
- if (isset($userInfo['data']['data']['vip']['curYearCostPer'])) {
|
|
|
274
|
- $userInfo['data']['data']['vip']['curYearCostPer'] = intval($userInfo['data']['data']['vip']['curYearCostPer']);
|
|
|
275
|
- }
|
|
|
276
|
- $userInfo['data']['result'] = 1;
|
|
|
277
|
- $this->helpJsonCallbackResult($callback, 200,'User info', $userInfo['data']);
|
|
|
278
|
- } else {
|
280
|
+
|
|
|
281
|
+ } while(false);
|
|
|
282
|
+
|
|
|
283
|
+ if (empty($userInfo)) {
|
279
|
$this->helpJsonCallbackResult($callback, 403,'User info', '');
|
284
|
$this->helpJsonCallbackResult($callback, 403,'User info', '');
|
|
|
285
|
+ } else {
|
|
|
286
|
+ $this->helpJsonCallbackResult($callback, 200,'User info', $userInfo);
|
280
|
}
|
287
|
}
|
|
|
288
|
+
|
281
|
}
|
289
|
}
|
282
|
|
290
|
|
283
|
/**
|
291
|
/**
|
|
@@ -298,7 +306,6 @@ class CommonController extends WebAction |
|
@@ -298,7 +306,6 @@ class CommonController extends WebAction |
298
|
$sknArray = explode('-', $val);
|
306
|
$sknArray = explode('-', $val);
|
299
|
$skn[]= $sknArray[0];
|
307
|
$skn[]= $sknArray[0];
|
300
|
}
|
308
|
}
|
301
|
-// rsort($skn);
|
|
|
302
|
$skn = array_slice($skn, 0 ,$limit);
|
309
|
$skn = array_slice($skn, 0 ,$limit);
|
303
|
$result = SearchModel::historyProduct($skn, $limit);
|
310
|
$result = SearchModel::historyProduct($skn, $limit);
|
304
|
} while(false);
|
311
|
} while(false);
|