...
|
...
|
@@ -10,7 +10,7 @@ use Plugin\Helpers; |
|
|
|
|
|
/**
|
|
|
* Description of Order
|
|
|
*
|
|
|
*
|
|
|
*/
|
|
|
class OrderModel
|
|
|
{
|
...
|
...
|
@@ -21,7 +21,7 @@ class OrderModel |
|
|
|
|
|
/**
|
|
|
* 订单相关数据处理
|
|
|
*
|
|
|
*
|
|
|
* payment_type:
|
|
|
'1' => array(//在线支付
|
|
|
0 => '待付款',
|
...
|
...
|
@@ -98,7 +98,7 @@ class OrderModel |
|
|
|
|
|
/**
|
|
|
* 查看物流
|
|
|
*
|
|
|
*
|
|
|
* @param int $orderCode 订单编号
|
|
|
* @param int $uid 用户ID
|
|
|
* @return array
|
...
|
...
|
@@ -185,7 +185,7 @@ class OrderModel |
|
|
|
|
|
/**
|
|
|
* 获取订单详情信息
|
|
|
*
|
|
|
*
|
|
|
* @param string $orderCode 订单号
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $sessionKey 用户的会话
|
...
|
...
|
@@ -197,6 +197,7 @@ class OrderModel |
|
|
|
|
|
if (is_numeric($orderCode) && is_numeric($uid) && is_string($sessionKey)) {
|
|
|
$orderDetail = OrderData::viewOrderData($orderCode, $uid, $sessionKey);
|
|
|
print_r($orderDetail);
|
|
|
if (isset($orderDetail['data']['order_code'])) {
|
|
|
$count = 0;
|
|
|
|
...
|
...
|
@@ -252,7 +253,7 @@ class OrderModel |
|
|
|
|
|
/**
|
|
|
* 获取订单状态
|
|
|
*
|
|
|
*
|
|
|
* @param array $order 订单
|
|
|
* @param bool $showLogistics 控制是否显示物流信息
|
|
|
* @return array
|
...
|
...
|
@@ -361,4 +362,85 @@ class OrderModel |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取拆单信息数据
|
|
|
* @param type $uid 用户id
|
|
|
* @param type $cartType 购物车类型
|
|
|
* @param type $skuList 商品信息
|
|
|
* @return boolean
|
|
|
*/
|
|
|
public static function getPackageInfo($orderCode, $uid, $sessionKey)
|
|
|
{
|
|
|
$result = array();
|
|
|
$carpay = OrderData::viewOrderData($orderCode, $uid, $sessionKey);
|
|
|
// print_r($carpay);
|
|
|
do {
|
|
|
// if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['package_list'])) {
|
|
|
// break;
|
|
|
// }
|
|
|
// $package = $carpay['data'];
|
|
|
// // 拆单数据
|
|
|
// if (isset($package['package_list']) && !empty($package['package_list'])) {
|
|
|
// $result['jitDetailPage'] = true;
|
|
|
// $packageList = $package['data']['package_list'];
|
|
|
// foreach ($packageList as $pk => $pv) {
|
|
|
// $result['packages'][$pk]['packageType'] = $pk + 1;
|
|
|
// $result['packages'][$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '总仓库' : '异地调拨'; //仓库
|
|
|
// $goodList = $pv['goods_list'];
|
|
|
// foreach ($goodList as $glk => $glv) {
|
|
|
// $result['packages'][$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 235, 314);
|
|
|
// $tag = isset($glv['goods_type']) ? $glv['goods_type'] : '';
|
|
|
// switch ($tag) {
|
|
|
// case 'price_gift' :
|
|
|
// //加价购
|
|
|
// $result['packages'][$pk]['goods'][$glk]['isAdd'] = true;
|
|
|
// break;
|
|
|
// case 'gift' :
|
|
|
// //赠品
|
|
|
// $result['packages'][$pk]['goods'][$glk]['isGift'] = true;
|
|
|
// break;
|
|
|
// default:
|
|
|
// break;
|
|
|
// }
|
|
|
// }
|
|
|
// $result['packages'][$pk]['expressCost'] = $pv['shopping_cost'];//运费
|
|
|
// $result['packages'][$pk]['discount'] = $pv['shopping_cut_cost'];//已优惠
|
|
|
// }
|
|
|
// }
|
|
|
if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['shopping_cart_data'])) {
|
|
|
break;
|
|
|
}
|
|
|
$package = $carpay['data'];
|
|
|
// 拆单数据
|
|
|
if (isset($package['shopping_cart_data']) && !empty($package['shopping_cart_data'])) {
|
|
|
$result['jitDetailPage'] = true;
|
|
|
$packageList = $package['shopping_cart_data']['package_list'];
|
|
|
foreach ($packageList as $pk => $pv) {
|
|
|
$result['packages'][$pk]['packageType'] = $pk + 1;
|
|
|
$result['packages'][$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '总仓库' : '异地调拨'; //仓库
|
|
|
$goodList = $pv['goods_list'];
|
|
|
foreach ($goodList as $glk => $glv) {
|
|
|
$result['packages'][$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 235, 314);
|
|
|
$tag = isset($glv['goods_type']) ? $glv['goods_type'] : '';
|
|
|
switch ($tag) {
|
|
|
case 'price_gift' :
|
|
|
//加价购
|
|
|
$result['packages'][$pk]['goods'][$glk]['isAdd'] = true;
|
|
|
break;
|
|
|
case 'gift' :
|
|
|
//赠品
|
|
|
$result['packages'][$pk]['goods'][$glk]['isGift'] = true;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
$result['packages'][$pk]['expressCost'] = $pv['shopping_cost']; //运费
|
|
|
$result['packages'][$pk]['discount'] = $pv['shopping_cut_cost']; //已优惠
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
while (false);
|
|
|
return $result;
|
|
|
}
|
|
|
} |
...
|
...
|
|