|
@@ -197,6 +197,7 @@ class OrderModel |
|
@@ -197,6 +197,7 @@ class OrderModel |
197
|
|
197
|
|
198
|
if (is_numeric($orderCode) && is_numeric($uid) && is_string($sessionKey)) {
|
198
|
if (is_numeric($orderCode) && is_numeric($uid) && is_string($sessionKey)) {
|
199
|
$orderDetail = OrderData::viewOrderData($orderCode, $uid, $sessionKey);
|
199
|
$orderDetail = OrderData::viewOrderData($orderCode, $uid, $sessionKey);
|
|
|
200
|
+ print_r($orderDetail);
|
200
|
if (isset($orderDetail['data']['order_code'])) {
|
201
|
if (isset($orderDetail['data']['order_code'])) {
|
201
|
$count = 0;
|
202
|
$count = 0;
|
202
|
|
203
|
|
|
@@ -361,4 +362,85 @@ class OrderModel |
|
@@ -361,4 +362,85 @@ class OrderModel |
361
|
}
|
362
|
}
|
362
|
}
|
363
|
}
|
363
|
|
364
|
|
|
|
365
|
+ /**
|
|
|
366
|
+ * 获取拆单信息数据
|
|
|
367
|
+ * @param type $uid 用户id
|
|
|
368
|
+ * @param type $cartType 购物车类型
|
|
|
369
|
+ * @param type $skuList 商品信息
|
|
|
370
|
+ * @return boolean
|
|
|
371
|
+ */
|
|
|
372
|
+ public static function getPackageInfo($orderCode, $uid, $sessionKey)
|
|
|
373
|
+ {
|
|
|
374
|
+ $result = array();
|
|
|
375
|
+ $carpay = OrderData::viewOrderData($orderCode, $uid, $sessionKey);
|
|
|
376
|
+// print_r($carpay);
|
|
|
377
|
+ do {
|
|
|
378
|
+// if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['package_list'])) {
|
|
|
379
|
+// break;
|
|
|
380
|
+// }
|
|
|
381
|
+// $package = $carpay['data'];
|
|
|
382
|
+// // 拆单数据
|
|
|
383
|
+// if (isset($package['package_list']) && !empty($package['package_list'])) {
|
|
|
384
|
+// $result['jitDetailPage'] = true;
|
|
|
385
|
+// $packageList = $package['data']['package_list'];
|
|
|
386
|
+// foreach ($packageList as $pk => $pv) {
|
|
|
387
|
+// $result['packages'][$pk]['packageType'] = $pk + 1;
|
|
|
388
|
+// $result['packages'][$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '总仓库' : '异地调拨'; //仓库
|
|
|
389
|
+// $goodList = $pv['goods_list'];
|
|
|
390
|
+// foreach ($goodList as $glk => $glv) {
|
|
|
391
|
+// $result['packages'][$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 235, 314);
|
|
|
392
|
+// $tag = isset($glv['goods_type']) ? $glv['goods_type'] : '';
|
|
|
393
|
+// switch ($tag) {
|
|
|
394
|
+// case 'price_gift' :
|
|
|
395
|
+// //加价购
|
|
|
396
|
+// $result['packages'][$pk]['goods'][$glk]['isAdd'] = true;
|
|
|
397
|
+// break;
|
|
|
398
|
+// case 'gift' :
|
|
|
399
|
+// //赠品
|
|
|
400
|
+// $result['packages'][$pk]['goods'][$glk]['isGift'] = true;
|
|
|
401
|
+// break;
|
|
|
402
|
+// default:
|
|
|
403
|
+// break;
|
|
|
404
|
+// }
|
|
|
405
|
+// }
|
|
|
406
|
+// $result['packages'][$pk]['expressCost'] = $pv['shopping_cost'];//运费
|
|
|
407
|
+// $result['packages'][$pk]['discount'] = $pv['shopping_cut_cost'];//已优惠
|
|
|
408
|
+// }
|
|
|
409
|
+// }
|
|
|
410
|
+ if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['shopping_cart_data'])) {
|
|
|
411
|
+ break;
|
|
|
412
|
+ }
|
|
|
413
|
+ $package = $carpay['data'];
|
|
|
414
|
+ // 拆单数据
|
|
|
415
|
+ if (isset($package['shopping_cart_data']) && !empty($package['shopping_cart_data'])) {
|
|
|
416
|
+ $result['jitDetailPage'] = true;
|
|
|
417
|
+ $packageList = $package['shopping_cart_data']['package_list'];
|
|
|
418
|
+ foreach ($packageList as $pk => $pv) {
|
|
|
419
|
+ $result['packages'][$pk]['packageType'] = $pk + 1;
|
|
|
420
|
+ $result['packages'][$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '总仓库' : '异地调拨'; //仓库
|
|
|
421
|
+ $goodList = $pv['goods_list'];
|
|
|
422
|
+ foreach ($goodList as $glk => $glv) {
|
|
|
423
|
+ $result['packages'][$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 235, 314);
|
|
|
424
|
+ $tag = isset($glv['goods_type']) ? $glv['goods_type'] : '';
|
|
|
425
|
+ switch ($tag) {
|
|
|
426
|
+ case 'price_gift' :
|
|
|
427
|
+ //加价购
|
|
|
428
|
+ $result['packages'][$pk]['goods'][$glk]['isAdd'] = true;
|
|
|
429
|
+ break;
|
|
|
430
|
+ case 'gift' :
|
|
|
431
|
+ //赠品
|
|
|
432
|
+ $result['packages'][$pk]['goods'][$glk]['isGift'] = true;
|
|
|
433
|
+ break;
|
|
|
434
|
+ default:
|
|
|
435
|
+ break;
|
|
|
436
|
+ }
|
|
|
437
|
+ }
|
|
|
438
|
+ $result['packages'][$pk]['expressCost'] = $pv['shopping_cost']; //运费
|
|
|
439
|
+ $result['packages'][$pk]['discount'] = $pv['shopping_cut_cost']; //已优惠
|
|
|
440
|
+ }
|
|
|
441
|
+ }
|
|
|
442
|
+ }
|
|
|
443
|
+ while (false);
|
|
|
444
|
+ return $result;
|
|
|
445
|
+ }
|
364
|
} |
446
|
} |