Ver Fonte

使用新的配送方式

shish há 2 semanas atrás
pai
commit
f3a3cff5b1

+ 4 - 0
app-hd/controllers/GhsController.php

@@ -321,6 +321,10 @@ class GhsController extends BaseController
         }
         $ghsInfo['hcMap'] = $hcMap;
 
+        //是否使用新的配送方式,关键词 sh_method_area
+        $newShMethod = dict::getDict('newShMethod');
+        $ghsInfo['useNewShMethod'] = in_array($ghsShopId, $newShMethod)? 1 : 0 ;
+
         util::success($ghsInfo);
     }
 

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

@@ -632,8 +632,9 @@ class PurchaseController extends BaseController
                 $post['localOrder'] = 1;
             } else {
 
-                // xhShMethod 门店:下单前按配置写入不满最低消费时的附加包装费/运费,关键词sh_method_area
-                if (in_array($ghsShopId, [36523])) {
+                // xhShMethod 门店:下单前按配置写入不满最低消费时的附加包装费/运费,关键词 sh_method_area
+                $newShMethod = dict::getDict('newShMethod');
+                if (in_array($ghsShopId, $newShMethod)) {
                     $shMethodBigNum = 0;
                     foreach ($productList as $itemData) {
                         $shMethodBigNum += floatval($itemData['bigNum'] ?? 0);
@@ -728,8 +729,9 @@ class PurchaseController extends BaseController
 
             $respond = PurchaseService::createPurchase($post, $ghsInfo);
 
-            if (in_array($ghsShopId, [36523])) {
-                // 使用 xhShMethod 配置校验配送限制,替代旧版门店硬编码规则,关键词sh_method_area
+            $newShMethod = dict::getDict('newShMethod');
+            if (in_array($ghsShopId, $newShMethod)) {
+                // 使用 xhShMethod 配置校验配送限制,替代旧版门店硬编码规则,关键词 sh_method_area
                 $shMethodError = ShMethodClass::checkLimit(
                     $ghsShopId,
                     $ghsMainId,

+ 2 - 0
common/components/dict.php

@@ -8,6 +8,8 @@ class dict
 {
 
     public static $data = [
+		//使用新的配送方式
+        'newShMethod'=>[36523],
         // 配送方式默认配置
         'shMethod' => [
             0 => [