|
|
@@ -110,16 +110,20 @@ class DeliveryQuoteUtil
|
|
|
$sendDistance = $result['distance'] ?? 0;
|
|
|
|
|
|
// 11. 应用免费配送规则
|
|
|
- $finalSendCost = self::applyFreeDeliveryRules(
|
|
|
- $sendCost,
|
|
|
- $sendDistance,
|
|
|
- $params['ghsInfo']['shopId'],
|
|
|
- $params['productCount'] ?? 0,
|
|
|
- $params['order']['itemTotalAmount'] ?? 0,
|
|
|
- $params['ghsInfo']['mainId'],
|
|
|
- $order['orderSn'],
|
|
|
- $order['goodsType']
|
|
|
- );
|
|
|
+ if(isset($order['freightType']) && $order['freightType'] == 0) {
|
|
|
+ $finalSendCost= $sendCost;
|
|
|
+ }else{
|
|
|
+ $finalSendCost = self::applyFreeDeliveryRules(
|
|
|
+ $sendCost,
|
|
|
+ $sendDistance,
|
|
|
+ $params['ghsInfo']['shopId'],
|
|
|
+ $params['productCount'] ?? 0,
|
|
|
+ $params['order']['itemTotalAmount'] ?? 0,
|
|
|
+ $params['ghsInfo']['mainId'],
|
|
|
+ $order['orderSn'],
|
|
|
+ $order['goodsType']
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
return [
|
|
|
'sendCost' => $finalSendCost,
|
|
|
@@ -162,7 +166,7 @@ class DeliveryQuoteUtil
|
|
|
$custom = $params['custom'];
|
|
|
$orderInfo = $params['order'];
|
|
|
|
|
|
- return [
|
|
|
+ $order = [
|
|
|
'orderSn' => $orderInfo['orderSn'],
|
|
|
'customName' => $custom->name,
|
|
|
'customMobile' => $custom->mobile,
|
|
|
@@ -177,7 +181,14 @@ class DeliveryQuoteUtil
|
|
|
'remark' => $orderInfo['remark'] ?? '',
|
|
|
'prePrice' => $orderInfo['itemTotalAmount'] ?? 0,
|
|
|
'actPrice' => $orderInfo['itemTotalAmount'] ?? 0,
|
|
|
+ 'goodsType' => $orderInfo['goodsType'],
|
|
|
];
|
|
|
+
|
|
|
+ if(isset($orderInfo['freightType'])){
|
|
|
+ $order['freightType'] = $orderInfo['freightType'];
|
|
|
+ }
|
|
|
+
|
|
|
+ return $order;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -202,8 +213,7 @@ class DeliveryQuoteUtil
|
|
|
$ghsMainId,
|
|
|
$orderSn,
|
|
|
$goodsType
|
|
|
- )
|
|
|
- {
|
|
|
+ ){
|
|
|
// 获取店铺扩展信息(免费配送设置)
|
|
|
$shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], false, null, 'id,hcFreeKm,hcMap,hsFreeKm,hsAddFee');
|
|
|
if (empty($shopExt)) {
|