|
@@ -59,7 +59,7 @@ class CartModel |
|
@@ -59,7 +59,7 @@ class CartModel |
59
|
$result['isEmpty'] = true;
|
59
|
$result['isEmpty'] = true;
|
60
|
$result['guangUrl'] = Helpers::url('', null, 'list');
|
60
|
$result['guangUrl'] = Helpers::url('', null, 'list');
|
61
|
$result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time()));
|
61
|
$result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time()));
|
62
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'shoppingKey:'.$shoppingKey);
|
62
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
|
63
|
break;
|
63
|
break;
|
64
|
}
|
64
|
}
|
65
|
|
65
|
|
|
@@ -107,16 +107,14 @@ class CartModel |
|
@@ -107,16 +107,14 @@ class CartModel |
107
|
$result['productAllA'] = Helpers::transPrice($advanceCartData['shopping_cart_data']['last_order_amount']);
|
107
|
$result['productAllA'] = Helpers::transPrice($advanceCartData['shopping_cart_data']['last_order_amount']);
|
108
|
// 获赠YOHO币个数
|
108
|
// 获赠YOHO币个数
|
109
|
$result['getYoho'] = $advanceCartData['shopping_cart_data']['gain_yoho_coin'];
|
109
|
$result['getYoho'] = $advanceCartData['shopping_cart_data']['gain_yoho_coin'];
|
110
|
- }
|
|
|
111
|
- // 普通的
|
110
|
+ } // 普通的
|
112
|
elseif ($ordinaryCount !== 0 && $advanceCount === 0) {
|
111
|
elseif ($ordinaryCount !== 0 && $advanceCount === 0) {
|
113
|
//$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount']);
|
112
|
//$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount']);
|
114
|
$result['productAmmount'] = self::genProductAmount($ordinaryCartData['shopping_cart_data']['promotion_formula_list'], $ordinaryCartData['shopping_cart_data']['order_amount']);
|
113
|
$result['productAmmount'] = self::genProductAmount($ordinaryCartData['shopping_cart_data']['promotion_formula_list'], $ordinaryCartData['shopping_cart_data']['order_amount']);
|
115
|
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount']);
|
114
|
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount']);
|
116
|
$result['productAllA'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['last_order_amount']);
|
115
|
$result['productAllA'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['last_order_amount']);
|
117
|
$result['getYoho'] = $ordinaryCartData['shopping_cart_data']['gain_yoho_coin'];
|
116
|
$result['getYoho'] = $ordinaryCartData['shopping_cart_data']['gain_yoho_coin'];
|
118
|
- }
|
|
|
119
|
- // 所有的
|
117
|
+ } // 所有的
|
120
|
else {
|
118
|
else {
|
121
|
$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount'] + $advanceCartData['shopping_cart_data']['order_amount']);
|
119
|
$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount'] + $advanceCartData['shopping_cart_data']['order_amount']);
|
122
|
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount'] + $advanceCartData['shopping_cart_data']['discount_amount']);
|
120
|
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount'] + $advanceCartData['shopping_cart_data']['discount_amount']);
|
|
@@ -185,8 +183,7 @@ class CartModel |
|
@@ -185,8 +183,7 @@ class CartModel |
185
|
// 普通的
|
183
|
// 普通的
|
186
|
if (!empty($ordinaryCartData['promotion_info'])) {
|
184
|
if (!empty($ordinaryCartData['promotion_info'])) {
|
187
|
$result['salesPromotion'] = self::buildPromotionData($ordinaryCartData['promotion_info']);
|
185
|
$result['salesPromotion'] = self::buildPromotionData($ordinaryCartData['promotion_info']);
|
188
|
- }
|
|
|
189
|
- // 预售的
|
186
|
+ } // 预售的
|
190
|
elseif (!empty($advanceCartData['promotion_info'])) {
|
187
|
elseif (!empty($advanceCartData['promotion_info'])) {
|
191
|
//$result['salesPromotion'] = array_merge($result['salesPromotion'], self::buildPromotionData($advanceCartData['promotion_info']));
|
188
|
//$result['salesPromotion'] = array_merge($result['salesPromotion'], self::buildPromotionData($advanceCartData['promotion_info']));
|
192
|
$result['salesPromotion'] = self::buildPromotionData($advanceCartData['promotion_info']);
|
189
|
$result['salesPromotion'] = self::buildPromotionData($advanceCartData['promotion_info']);
|
|
@@ -227,8 +224,8 @@ class CartModel |
|
@@ -227,8 +224,8 @@ class CartModel |
227
|
$addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
|
224
|
$addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
|
228
|
if ($addCart && isset($addCart['code'])) {
|
225
|
if ($addCart && isset($addCart['code'])) {
|
229
|
$result = $addCart;
|
226
|
$result = $addCart;
|
230
|
- }else{
|
|
|
231
|
- UdpLog::info('【购物车】校验参数传递auth','productSku:'.$productSku.'buyNumber:'.$buyNumber.'goodsType:'.$goodsType,'isEdit:'.$isEdit.'promotionId:'.$promotionId.'uid:'.$uid.'shoppingKey:'.$shoppingKey);
|
227
|
+ } else {
|
|
|
228
|
+ UdpLog::info('【购物车】校验参数传递auth', 'productSku:' . $productSku . 'buyNumber:' . $buyNumber . 'goodsType:' . $goodsType, 'isEdit:' . $isEdit . 'promotionId:' . $promotionId . 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
|
232
|
}
|
229
|
}
|
233
|
|
230
|
|
234
|
return $result;
|
231
|
return $result;
|
|
@@ -249,7 +246,7 @@ class CartModel |
|
@@ -249,7 +246,7 @@ class CartModel |
249
|
|
246
|
|
250
|
do {
|
247
|
do {
|
251
|
if (empty($skuList)) {
|
248
|
if (empty($skuList)) {
|
252
|
- UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
|
249
|
+ UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
|
253
|
break;
|
250
|
break;
|
254
|
}
|
251
|
}
|
255
|
|
252
|
|
|
@@ -257,8 +254,8 @@ class CartModel |
|
@@ -257,8 +254,8 @@ class CartModel |
257
|
if ($select && isset($select['code'])) {
|
254
|
if ($select && isset($select['code'])) {
|
258
|
$result['code'] = $select['code'];
|
255
|
$result['code'] = $select['code'];
|
259
|
$result['message'] = $select['message'];
|
256
|
$result['message'] = $select['message'];
|
260
|
- }else{
|
|
|
261
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion);
|
257
|
+ } else {
|
|
|
258
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
|
262
|
}
|
259
|
}
|
263
|
} while (false);
|
260
|
} while (false);
|
264
|
|
261
|
|
|
@@ -281,7 +278,7 @@ class CartModel |
|
@@ -281,7 +278,7 @@ class CartModel |
281
|
|
278
|
|
282
|
do {
|
279
|
do {
|
283
|
if (empty($skuList)) {
|
280
|
if (empty($skuList)) {
|
284
|
- UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
|
281
|
+ UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
|
285
|
break;
|
282
|
break;
|
286
|
}
|
283
|
}
|
287
|
|
284
|
|
|
@@ -292,8 +289,8 @@ class CartModel |
|
@@ -292,8 +289,8 @@ class CartModel |
292
|
if (isset($remove['data']['goods_count'])) {
|
289
|
if (isset($remove['data']['goods_count'])) {
|
293
|
$result['total_goods_num'] = $remove['data']['goods_count'];
|
290
|
$result['total_goods_num'] = $remove['data']['goods_count'];
|
294
|
}
|
291
|
}
|
295
|
- }else{
|
|
|
296
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion);
|
292
|
+ } else {
|
|
|
293
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
|
297
|
}
|
294
|
}
|
298
|
} while (false);
|
295
|
} while (false);
|
299
|
|
296
|
|
|
@@ -321,7 +318,7 @@ class CartModel |
|
@@ -321,7 +318,7 @@ class CartModel |
321
|
}
|
318
|
}
|
322
|
|
319
|
|
323
|
if (empty($skuList)) {
|
320
|
if (empty($skuList)) {
|
324
|
- UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
|
321
|
+ UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
|
325
|
break;
|
322
|
break;
|
326
|
}
|
323
|
}
|
327
|
|
324
|
|
|
@@ -329,8 +326,8 @@ class CartModel |
|
@@ -329,8 +326,8 @@ class CartModel |
329
|
if ($add && isset($add['code'])) {
|
326
|
if ($add && isset($add['code'])) {
|
330
|
$result['code'] = $add['code'];
|
327
|
$result['code'] = $add['code'];
|
331
|
$result['message'] = $add['message'];
|
328
|
$result['message'] = $add['message'];
|
332
|
- }else{
|
|
|
333
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'hasPromotion:'.$hasPromotion);
|
329
|
+ } else {
|
|
|
330
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'hasPromotion:' . $hasPromotion);
|
334
|
}
|
331
|
}
|
335
|
} while (false);
|
332
|
} while (false);
|
336
|
|
333
|
|
|
@@ -353,7 +350,7 @@ class CartModel |
|
@@ -353,7 +350,7 @@ class CartModel |
353
|
|
350
|
|
354
|
do {
|
351
|
do {
|
355
|
if (empty($sku)) {
|
352
|
if (empty($sku)) {
|
356
|
- UdpLog::info('【购物车】校验参数传递auth','sku:'.$sku);
|
353
|
+ UdpLog::info('【购物车】校验参数传递auth', 'sku:' . $sku);
|
357
|
break;
|
354
|
break;
|
358
|
}
|
355
|
}
|
359
|
|
356
|
|
|
@@ -361,8 +358,8 @@ class CartModel |
|
@@ -361,8 +358,8 @@ class CartModel |
361
|
if ($modify && isset($modify['code'])) {
|
358
|
if ($modify && isset($modify['code'])) {
|
362
|
$result['code'] = $modify['code'];
|
359
|
$result['code'] = $modify['code'];
|
363
|
$result['message'] = $modify['message'];
|
360
|
$result['message'] = $modify['message'];
|
364
|
- }else{
|
|
|
365
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'sku:'.$sku,'increaseNum:'.$increaseNum.'decreaseNum:'.$decreaseNum.'shoppingKey:'.$shoppingKey);
|
361
|
+ } else {
|
|
|
362
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'sku:' . $sku, 'increaseNum:' . $increaseNum . 'decreaseNum:' . $decreaseNum . 'shoppingKey:' . $shoppingKey);
|
366
|
}
|
363
|
}
|
367
|
} while (false);
|
364
|
} while (false);
|
368
|
|
365
|
|
|
@@ -420,6 +417,113 @@ class CartModel |
|
@@ -420,6 +417,113 @@ class CartModel |
420
|
}
|
417
|
}
|
421
|
|
418
|
|
422
|
/**
|
419
|
/**
|
|
|
420
|
+ * 获取为你优选商品 待处理
|
|
|
421
|
+ *
|
|
|
422
|
+ * @param $channel 频道
|
|
|
423
|
+ * @param $uid 用户id
|
|
|
424
|
+ * @param $udid 设备id
|
|
|
425
|
+ * @param int $page 分页页码
|
|
|
426
|
+ * @return array
|
|
|
427
|
+ * @internal param $rec_pos
|
|
|
428
|
+ * @internal param $limit
|
|
|
429
|
+ */
|
|
|
430
|
+ public static function getRecommendProduct($channel, $uid, $udid, $page)
|
|
|
431
|
+ {
|
|
|
432
|
+ $result = array('code' => 200, 'message' => '', 'data' => array('header' => '为你优选', 'hasPrev' => false, 'hasNext' => false, 'item' => array()));
|
|
|
433
|
+
|
|
|
434
|
+ do {
|
|
|
435
|
+ if (!is_numeric($page)) {
|
|
|
436
|
+ break;
|
|
|
437
|
+ }
|
|
|
438
|
+
|
|
|
439
|
+ $channelNum = 1;
|
|
|
440
|
+ switch ($channel) {
|
|
|
441
|
+ case 'boys':
|
|
|
442
|
+ $channelNum = 1;
|
|
|
443
|
+ break;
|
|
|
444
|
+ case 'girls':
|
|
|
445
|
+ $channelNum = 2;
|
|
|
446
|
+ break;
|
|
|
447
|
+ case 'kids':
|
|
|
448
|
+ $channelNum = 3;
|
|
|
449
|
+ break;
|
|
|
450
|
+ case 'lifestyle':
|
|
|
451
|
+ $channelNum = 4;
|
|
|
452
|
+ break;
|
|
|
453
|
+ default:
|
|
|
454
|
+ break;
|
|
|
455
|
+ }
|
|
|
456
|
+
|
|
|
457
|
+ $together = UserData::newPreference($channelNum, $uid, $udid, '100003', 30);
|
|
|
458
|
+ if (empty($together['data']['product_list'])) {
|
|
|
459
|
+ break;
|
|
|
460
|
+ }
|
|
|
461
|
+
|
|
|
462
|
+ $result['data']['hasNext'] = true;
|
|
|
463
|
+ $result['data']['hasPrev'] = true;
|
|
|
464
|
+
|
|
|
465
|
+ $build = array();
|
|
|
466
|
+ $begin = 0;
|
|
|
467
|
+ $end = 0;
|
|
|
468
|
+ switch ($page) {
|
|
|
469
|
+ case 1:
|
|
|
470
|
+ $begin = 0;
|
|
|
471
|
+ $end = 5;
|
|
|
472
|
+ break;
|
|
|
473
|
+ case 2:
|
|
|
474
|
+ $begin = 6;
|
|
|
475
|
+ $end = 11;
|
|
|
476
|
+ break;
|
|
|
477
|
+ case 3:
|
|
|
478
|
+ $begin = 12;
|
|
|
479
|
+ $end = 17;
|
|
|
480
|
+ break;
|
|
|
481
|
+ case 4:
|
|
|
482
|
+ $begin = 18;
|
|
|
483
|
+ $end = 23;
|
|
|
484
|
+ break;
|
|
|
485
|
+ case 5:
|
|
|
486
|
+ $begin = 18;
|
|
|
487
|
+ $end = 23;
|
|
|
488
|
+ break;
|
|
|
489
|
+ case 6:
|
|
|
490
|
+ $begin = 24;
|
|
|
491
|
+ $end = 30;
|
|
|
492
|
+ break;
|
|
|
493
|
+ default:
|
|
|
494
|
+ $begin = 0;
|
|
|
495
|
+ $end = 5;
|
|
|
496
|
+ break;
|
|
|
497
|
+ }
|
|
|
498
|
+ foreach ($together['data']['product_list'] as $key => $value) {
|
|
|
499
|
+ if ($key >= $begin && $key <= $end) {
|
|
|
500
|
+ $build = array();
|
|
|
501
|
+ $build['id'] = $value['product_id'];
|
|
|
502
|
+ $build['skn'] = $value['product_skn'];
|
|
|
503
|
+ $build['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_list'][0]['product_skc'], $value['cn_alphabet']);;
|
|
|
504
|
+ $build['title'] = $value['product_name'];
|
|
|
505
|
+ $build['img'] = Helpers::getImageUrl($value['default_images'], 100, 100);
|
|
|
506
|
+ $build['alt'] = $value['product_name'];
|
|
|
507
|
+ $build['price'] = $value['price']['sales_price'];
|
|
|
508
|
+ if ($value['price']['sales_price'] !== $value['price']['market_price']) {
|
|
|
509
|
+ $build['marketPrice'] = $value['price']['market_price'];
|
|
|
510
|
+ }
|
|
|
511
|
+
|
|
|
512
|
+ $result['data']['item'][] = $build;
|
|
|
513
|
+ }
|
|
|
514
|
+ }
|
|
|
515
|
+
|
|
|
516
|
+ // 当数据量不足6个时,判定为没有下一页
|
|
|
517
|
+ if ($page == 1 && !isset($result['data']['item'][5])) {
|
|
|
518
|
+ $result['data']['hasPrev'] = false;
|
|
|
519
|
+ $result['data']['hasNext'] = false;
|
|
|
520
|
+ }
|
|
|
521
|
+ } while (false);
|
|
|
522
|
+
|
|
|
523
|
+ return $result;
|
|
|
524
|
+ }
|
|
|
525
|
+
|
|
|
526
|
+ /**
|
423
|
* 获取最近浏览商品
|
527
|
* 获取最近浏览商品
|
424
|
*
|
528
|
*
|
425
|
* @param int $page 分页页码
|
529
|
* @param int $page 分页页码
|
|
@@ -436,7 +540,7 @@ class CartModel |
|
@@ -436,7 +540,7 @@ class CartModel |
436
|
|
540
|
|
437
|
$browse = CartData::browseRecord($uid, $udid, $page, 6);
|
541
|
$browse = CartData::browseRecord($uid, $udid, $page, 6);
|
438
|
if (empty($browse['data']['product_list'])) {
|
542
|
if (empty($browse['data']['product_list'])) {
|
439
|
- UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'udid'.$udid.'page'.$page);
|
543
|
+ UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'udid' . $udid . 'page' . $page);
|
440
|
break;
|
544
|
break;
|
441
|
}
|
545
|
}
|
442
|
|
546
|
|
|
@@ -595,8 +699,7 @@ class CartModel |
|
@@ -595,8 +699,7 @@ class CartModel |
595
|
if ($value['payment_type'] == 1 && $value['is_support'] === 'Y') {
|
699
|
if ($value['payment_type'] == 1 && $value['is_support'] === 'Y') {
|
596
|
$result['onlinePay']['checked'] = $isDefault ? true : false;
|
700
|
$result['onlinePay']['checked'] = $isDefault ? true : false;
|
597
|
$result['onlinePay']['paymentId'] = $value['payment_id'];
|
701
|
$result['onlinePay']['paymentId'] = $value['payment_id'];
|
598
|
- }
|
|
|
599
|
- // 货到付款
|
702
|
+ } // 货到付款
|
600
|
elseif ($value['payment_type'] == 2 && $value['is_support'] === 'Y') {
|
703
|
elseif ($value['payment_type'] == 2 && $value['is_support'] === 'Y') {
|
601
|
$result['deliveryPay']['checked'] = $isDefault ? true : false;
|
704
|
$result['deliveryPay']['checked'] = $isDefault ? true : false;
|
602
|
$result['deliveryPay']['paymentId'] = $value['payment_id'];
|
705
|
$result['deliveryPay']['paymentId'] = $value['payment_id'];
|
|
@@ -609,9 +712,9 @@ class CartModel |
|
@@ -609,9 +712,9 @@ class CartModel |
609
|
}
|
712
|
}
|
610
|
}
|
713
|
}
|
611
|
// tar add 1605061351 货到付款提示信息处理
|
714
|
// tar add 1605061351 货到付款提示信息处理
|
612
|
- if(isset($pay['data']['payment_way'])){
|
715
|
+ if (isset($pay['data']['payment_way'])) {
|
613
|
foreach ($pay['data']['payment_way'] as $item) {
|
716
|
foreach ($pay['data']['payment_way'] as $item) {
|
614
|
- if($item['payment_type'] === 2){
|
717
|
+ if ($item['payment_type'] === 2) {
|
615
|
$result['paymentInCashInfo'] = $item['is_support_message'];
|
718
|
$result['paymentInCashInfo'] = $item['is_support_message'];
|
616
|
}
|
719
|
}
|
617
|
}
|
720
|
}
|
|
@@ -778,8 +881,7 @@ class CartModel |
|
@@ -778,8 +881,7 @@ class CartModel |
778
|
|
881
|
|
779
|
//JIT拆单需求 package
|
882
|
//JIT拆单需求 package
|
780
|
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
|
883
|
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
|
781
|
- }
|
|
|
782
|
- while (false);
|
884
|
+ } while (false);
|
783
|
|
885
|
|
784
|
return $result;
|
886
|
return $result;
|
785
|
}
|
887
|
}
|
|
@@ -797,17 +899,17 @@ class CartModel |
|
@@ -797,17 +899,17 @@ class CartModel |
797
|
if ($isMulti) {
|
899
|
if ($isMulti) {
|
798
|
$packageList = $cartInfo['package_list'];
|
900
|
$packageList = $cartInfo['package_list'];
|
799
|
foreach ($packageList as $pk => $pv) {
|
901
|
foreach ($packageList as $pk => $pv) {
|
800
|
- $pIndex = $pk+1;
|
|
|
801
|
- $packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹'.$pIndex.':总仓发货' : '包裹'.$pIndex.':异地调拨'; //仓库
|
902
|
+ $pIndex = $pk + 1;
|
|
|
903
|
+ $packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹' . $pIndex . ':总仓发货' : '包裹' . $pIndex . ':异地调拨'; //仓库
|
802
|
$goodList = $pv['goods_list'];
|
904
|
$goodList = $pv['goods_list'];
|
803
|
foreach ($goodList as $glk => $glv) {
|
905
|
foreach ($goodList as $glk => $glv) {
|
804
|
$packages[$pk]['goodlist'][$glk]['src'] = Images::getImageUrl($glv['goods_images'], 90, 90);
|
906
|
$packages[$pk]['goodlist'][$glk]['src'] = Images::getImageUrl($glv['goods_images'], 90, 90);
|
805
|
- $tagInfo= isset(ChannelConfig::$orderTagArr[$glv['goods_type']])?ChannelConfig::$orderTagArr[$glv['goods_type']]:'';
|
|
|
806
|
- $packages[$pk]['goodlist'][$glk]['goodsType'] =!empty($tagInfo['name'])?$tagInfo['name']:false;
|
|
|
807
|
- $packages[$pk]['goodlist'][$glk]['classname'] =!empty($tagInfo['classname'])?$tagInfo['classname']:false;
|
907
|
+ $tagInfo = isset(ChannelConfig::$orderTagArr[$glv['goods_type']]) ? ChannelConfig::$orderTagArr[$glv['goods_type']] : '';
|
|
|
908
|
+ $packages[$pk]['goodlist'][$glk]['goodsType'] = !empty($tagInfo['name']) ? $tagInfo['name'] : false;
|
|
|
909
|
+ $packages[$pk]['goodlist'][$glk]['classname'] = !empty($tagInfo['classname']) ? $tagInfo['classname'] : false;
|
808
|
$packages[$pk]['goodlist'][$glk]['link'] = 'javascript:void(0)';
|
910
|
$packages[$pk]['goodlist'][$glk]['link'] = 'javascript:void(0)';
|
809
|
}
|
911
|
}
|
810
|
- $packages[$pk]['fee'] = ($pv['shopping_cost']=='0.00')?false:$pv['shopping_cost'];
|
912
|
+ $packages[$pk]['fee'] = ($pv['shopping_cost'] == '0.00') ? false : $pv['shopping_cost'];
|
811
|
$packages[$pk]['orign'] = $pv['shopping_orig_cost'];
|
913
|
$packages[$pk]['orign'] = $pv['shopping_orig_cost'];
|
812
|
$packages[$pk]['count'] = $pv['shopping_cut_cost'];
|
914
|
$packages[$pk]['count'] = $pv['shopping_cut_cost'];
|
813
|
}
|
915
|
}
|
|
@@ -828,7 +930,7 @@ class CartModel |
|
@@ -828,7 +930,7 @@ class CartModel |
828
|
* @param int $redEnvelopes 红包
|
930
|
* @param int $redEnvelopes 红包
|
829
|
* @return array 接口返回的数据
|
931
|
* @return array 接口返回的数据
|
830
|
*/
|
932
|
*/
|
831
|
- public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes)
|
933
|
+ public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes)
|
832
|
{
|
934
|
{
|
833
|
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE, 'data' => array());
|
935
|
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE, 'data' => array());
|
834
|
|
936
|
|
|
@@ -836,7 +938,7 @@ class CartModel |
|
@@ -836,7 +938,7 @@ class CartModel |
836
|
if (!empty($yohoCoin)) {
|
938
|
if (!empty($yohoCoin)) {
|
837
|
$yohoCoin = intval($yohoCoin) / 100;
|
939
|
$yohoCoin = intval($yohoCoin) / 100;
|
838
|
}
|
940
|
}
|
839
|
- $compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes);
|
941
|
+ $compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes);
|
840
|
if ($compute && isset($compute['code'])) {
|
942
|
if ($compute && isset($compute['code'])) {
|
841
|
/* 商品价格明细 */
|
943
|
/* 商品价格明细 */
|
842
|
if (!empty($compute['data']['promotion_formula_list'])) {
|
944
|
if (!empty($compute['data']['promotion_formula_list'])) {
|
|
@@ -904,19 +1006,19 @@ class CartModel |
|
@@ -904,19 +1006,19 @@ class CartModel |
904
|
|
1006
|
|
905
|
do {
|
1007
|
do {
|
906
|
if (empty($addressId)) {
|
1008
|
if (empty($addressId)) {
|
907
|
- UdpLog::info('【结算信息】配送地址参数校验','addressId为空');
|
1009
|
+ UdpLog::info('【结算信息】配送地址参数校验', 'addressId为空');
|
908
|
$result['code'] = 401;
|
1010
|
$result['code'] = 401;
|
909
|
$result['message'] = '配送地址不能为空';
|
1011
|
$result['message'] = '配送地址不能为空';
|
910
|
break;
|
1012
|
break;
|
911
|
}
|
1013
|
}
|
912
|
if (empty($deliveryTimeId)) {
|
1014
|
if (empty($deliveryTimeId)) {
|
913
|
- UdpLog::info('【结算信息】配送时间参数校验','deliveryTime为空');
|
1015
|
+ UdpLog::info('【结算信息】配送时间参数校验', 'deliveryTime为空');
|
914
|
$result['code'] = 402;
|
1016
|
$result['code'] = 402;
|
915
|
$result['message'] = '请选择配送时间';
|
1017
|
$result['message'] = '请选择配送时间';
|
916
|
break;
|
1018
|
break;
|
917
|
}
|
1019
|
}
|
918
|
if (empty($deliveryWayId)) {
|
1020
|
if (empty($deliveryWayId)) {
|
919
|
- UdpLog::info('【结算信息】配送方式参数校验','deliveryWay为空');
|
1021
|
+ UdpLog::info('【结算信息】配送方式参数校验', 'deliveryWay为空');
|
920
|
$result['code'] = 403;
|
1022
|
$result['code'] = 403;
|
921
|
$result['message'] = '请选择配送方式';
|
1023
|
$result['message'] = '请选择配送方式';
|
922
|
break;
|
1024
|
break;
|
|
@@ -1132,8 +1234,7 @@ class CartModel |
|
@@ -1132,8 +1234,7 @@ class CartModel |
1132
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
1234
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
1133
|
if (empty($result)) {
|
1235
|
if (empty($result)) {
|
1134
|
$result = Cache::get($key, 'slave');
|
1236
|
$result = Cache::get($key, 'slave');
|
1135
|
- }
|
|
|
1136
|
- // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
|
1237
|
+ } // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
|
1137
|
else {
|
1238
|
else {
|
1138
|
Cache::set($key, $result, 3600); // 缓存1小时
|
1239
|
Cache::set($key, $result, 3600); // 缓存1小时
|
1139
|
}
|
1240
|
}
|