Browse Source

出车和发快递可以算打包费

shish 3 years ago
parent
commit
4f841c4bd8
1 changed files with 6 additions and 2 deletions
  1. 6 2
      app-hd/controllers/PurchaseController.php

+ 6 - 2
app-hd/controllers/PurchaseController.php

@@ -108,7 +108,7 @@ class PurchaseController extends BaseController
 
             $sendType = $post['sendType'] ?? 0;
             $sendCost = 0;
-            $packCost = 0;
+
             if ($sendType == dict::getDict('sendType', 'thirdSend')) {
                 $weight = 0;
                 foreach ($productList as $itemData) {
@@ -117,9 +117,13 @@ class PurchaseController extends BaseController
                 }
                 $result = PurchaseClass::getDistanceFee($this->shop, $ghsShopInfo, $weight);
                 $sendCost = $result['fee'] ?? 0;
-                $packCost = $ghsShopInfo->packCost ?? 0;
             }
             $post['sendCost'] = $sendCost;
+            //出车和发快递可以算打包费
+            $packCost = 0;
+            if ($sendType == dict::getDict('sendType', 'thirdSend') || $sendType == dict::getDict('sendType', 'carGet')) {
+                $packCost = $ghsShopInfo->packCost ?? 0;
+            }
             $post['packCost'] = $packCost;
 
             $respond = PurchaseService::createPurchase($post, $ghsInfo);