Răsfoiți Sursa

昆明发往全国

shish 3 ani în urmă
părinte
comite
5fa9976571
1 a modificat fișierele cu 16 adăugiri și 4 ștergeri
  1. 16 4
      app-ghs/controllers/OrderController.php

+ 16 - 4
app-ghs/controllers/OrderController.php

@@ -924,11 +924,23 @@ class OrderController extends BaseController
         $post['book'] = $post['book'] ?? 0;
         $post['book'] = $post['book'] ?? 0;
 
 
         $sendType = $post['sendType'] ?? 0;
         $sendType = $post['sendType'] ?? 0;
-        $sendCost = isset($post['sendCost']) && $post['sendCost'] > 0 ? $post['sendCost'] : 0;
-        if ($sendType != dict::getDict('sendType', 'thirdSend') && $sendCost > 0) {
-            util::fail('填了运费,请选择跑腿配送');
+        $transType = $post['transType'] ?? 0;
+
+        $shop = $this->shop;
+        if (isset($shop->pfLevel) && $shop->pfLevel == 1) {
+            //昆明发往全国
+            $sendCost = isset($post['sendCost']) && $post['sendCost'] > 0 ? $post['sendCost'] : 0;
+            $post['sendCost'] = $sendCost;
+            $packCost = isset($post['packCost']) && $post['packCost'] > 0 ? $post['packCost'] : 0;
+            $post['packCost'] = $packCost;
+        } else {
+            //同步配送
+            $sendCost = isset($post['sendCost']) && $post['sendCost'] > 0 ? $post['sendCost'] : 0;
+            if ($sendType != dict::getDict('sendType', 'thirdSend') && $sendCost > 0) {
+                util::fail('填了运费,请选择代叫跑腿');
+            }
+            $post['sendCost'] = $sendCost;
         }
         }
-        $post['sendCost'] = $sendCost;
 
 
         $hasPay = $post['hasPay'] ?? dict::getDict('hasPay', 'unPay');
         $hasPay = $post['hasPay'] ?? dict::getDict('hasPay', 'unPay');
         $post['debt'] = OrderClass::DEBT_NO;
         $post['debt'] = OrderClass::DEBT_NO;