Jelajahi Sumber

跑腿 问题

shish 10 bulan lalu
induk
melakukan
8d4547a38c
2 mengubah file dengan 7 tambahan dan 11 penghapusan
  1. 4 1
      app-ghs/controllers/ShopExtController.php
  2. 3 10
      biz/shop/classes/ShopClass.php

+ 4 - 1
app-ghs/controllers/ShopExtController.php

@@ -91,6 +91,9 @@ class ShopExtController extends BaseController
         $arr = $ext->attributes ?? [];
         $arr['losingItemName'] = $losingItemName;
         $arr['zjGatheringItemName'] = $zjGatheringItemName;
+
+        $arr['main'] = $this->main;
+
         util::success($arr);
     }
 
@@ -98,7 +101,7 @@ class ShopExtController extends BaseController
     public function actionAddWcPrint()
     {
         $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+        if (!isset($shopAdmin->super) || $shopAdmin->super != 1) {
             util::fail('超管才能修改');
         }
         $shopId = $this->shopId;

+ 3 - 10
biz/shop/classes/ShopClass.php

@@ -25,10 +25,6 @@ class ShopClass extends BaseClass
     //商家是否有同城配送能力
     public static function hasIntraCity($shop)
     {
-        //万丽花行 跑腿不算运费
-        if ($shop->id == 12003) {
-            return ['openIntraCity' => 0, 'wxStoreId' => ''];
-        }
         $mainId = $shop->mainId ?? 0;
         $main = MainClass::getById($mainId, true);
         $wxStoreId = $main->wxStoreId ?? '';
@@ -36,16 +32,13 @@ class ShopClass extends BaseClass
         $long = $shop->long ?? '';
         $address = $shop->address ?? '';
         $hasMap = dict::getDict('hasMap');
-        if (getenv('YII_ENV') == 'production') {
-            $openIntraCityMainList = [50, 58668, 24162];
-        } else {
-            $openIntraCityMainList = [644];
-        }
+        $shopId = $shop->id;
+        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true, null, 'id,shopId,thirdSendFeeZd');
         $openIntraCity = 0;
         //有地图功能
         if ($hasMap == 1) {
             //有地址功能,并且叫跑腿功能开启
-            if (in_array($mainId, $openIntraCityMainList)) {
+            if ($ext->thirdSendFeeZd == 1) {
                 if (!empty($lat) && !empty($long) && !empty($address)) {
                     if (!empty($wxStoreId)) {
                         $openIntraCity = 1;