소스 검색

没有修改

shish 11 달 전
부모
커밋
830c1e82cb
2개의 변경된 파일13개의 추가작업 그리고 12개의 파일을 삭제
  1. 2 2
      app-hd/controllers/PurchaseController.php
  2. 11 10
      biz-hd/purchase/classes/PurchaseClass.php

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

@@ -1274,8 +1274,8 @@ class PurchaseController extends BaseController
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
 
 
         $shop = $this->shop;
         $shop = $this->shop;
-        $shopLat = isset($shop->lat) ? $shop->lat : '';
-        $shopLong = isset($shop->long) ? $shop->long : '';
+        $shopLat = $shop->lat ?? '';
+        $shopLong = $shop->long ?? '';
 
 
         if (empty($shopLat) || empty($shopLong)) {
         if (empty($shopLat) || empty($shopLong)) {
             util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);
             util::success(['distance' => 0, 'showDistance' => 0, 'fee' => 0]);

+ 11 - 10
biz-hd/purchase/classes/PurchaseClass.php

@@ -376,19 +376,23 @@ class PurchaseClass extends BaseClass
     }
     }
 
 
     //计算距离和运费【另外还有个地方要同步修改,关键词calc_freight_distance】 ssh 20221003
     //计算距离和运费【另外还有个地方要同步修改,关键词calc_freight_distance】 ssh 20221003
-    public static function getDistanceFee($shop, $ghsShop, $weight)
+    public static function getDistanceFee($shop, $ghsShop, $weight, $mustHasFee = false)
     {
     {
-        return ['distance' => 0, 'showDistance' => 0, 'fee' => 0];
 
 
-        $shopLat = isset($shop->lat) ? $shop->lat : '';
-        $shopLong = isset($shop->long) ? $shop->long : '';
+        //万丽花行 跑腿不算运费
+        if ($ghsShop->id == 12003) {
+            return ['distance' => 0, 'showDistance' => 0, 'fee' => 0];
+        }
+
+        $shopLat = $shop->lat ?? '';
+        $shopLong = $shop->long ?? '';
 
 
         if (empty($shopLat) || empty($shopLong)) {
         if (empty($shopLat) || empty($shopLong)) {
             util::fail('请完善门店地址哦');
             util::fail('请完善门店地址哦');
         }
         }
 
 
-        $ghsShopLat = isset($ghsShop->lat) ? $ghsShop->lat : '';
-        $ghsShopLong = isset($ghsShop->long) ? $ghsShop->long : '';
+        $ghsShopLat = $ghsShop->lat ?? '';
+        $ghsShopLong = $ghsShop->long ?? '';
         if (empty($ghsShopLat) || empty($ghsShopLong)) {
         if (empty($ghsShopLat) || empty($ghsShopLong)) {
             util::fail('商家地址有问题');
             util::fail('商家地址有问题');
         }
         }
@@ -452,10 +456,7 @@ class PurchaseClass extends BaseClass
 
 
         //noticeUtil::push("距离:{$distance} {$showDistance} 重量:{$weight} 费用:{$totalFee}", '15280215347');
         //noticeUtil::push("距离:{$distance} {$showDistance} 重量:{$weight} 费用:{$totalFee}", '15280215347');
 
 
-        //万丽花行 跑腿不算运费
-        if ($ghsShop->id == 12003) {
-            return ['distance' => 0, 'showDistance' => 0, 'fee' => 0];
-        }
+
         return ['distance' => $distance, 'showDistance' => $showDistance, 'fee' => $totalFee];
         return ['distance' => $distance, 'showDistance' => $showDistance, 'fee' => $totalFee];
     }
     }