Kaynağa Gözat

德邦运费

shish 2 yıl önce
ebeveyn
işleme
751646b705

+ 1 - 1
app-hd/controllers/ConsoleController.php

@@ -115,7 +115,7 @@ class ConsoleController extends BaseController
     //常用初始化
     public function actionInit()
     {
-        $dict = dict::get();
+        $dict = dict::get($this->mainId);
         $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
         util::success(['dict' => $dict, 'shop' => $shop]);
     }

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

@@ -340,7 +340,7 @@ class PurchaseController extends BaseController
 
                 $post['packCost'] = $packCost;
 
-                $transCost = dict::getDict('transCost');
+                $transCost = dict::getDict('transCost', null, null, $ghsShopInfo->mainId);
                 $sendCost = 0;
                 if (!empty($transCost)) {
                     foreach ($transCost as $trans) {

+ 55 - 2
common/components/dict.php

@@ -480,7 +480,7 @@ class dict
     ];
 
     //取配置文件的值
-    public static function getDict($category, $first = null, $second = null)
+    public static function getDict($category, $first = null, $second = null, $mainId = 0)
     {
         $respond = self::$data[$category];
         if (isset($first) && isset($second)) {
@@ -495,11 +495,38 @@ class dict
             }
             return $respond[$first];
         }
+
+        if (getenv('YII_ENV') == 'production') {
+            //老油云漫梦金鹏的德邦不需要收运费
+            if ($mainId == 20528 && $category == 'transCost') {
+                $respond = [
+                    ['sign' => 0, 'perKiloCost' => 5],
+                    ['sign' => 1, 'perKiloCost' => 0],
+                    ['sign' => 2, 'option' => [['num' => 20, 'amount' => 50], ['num' => 30, 'amount' => 80], ['num' => 50, 'amount' => 120], ['num' => 70, 'amount' => 180], ['num' => 100, 'amount' => 200]]],
+                    ['sign' => 3, 'perKiloCost' => 4],
+                    ['sign' => 4, 'perKiloCost' => 0],
+                    ['sign' => 5, 'perKiloCost' => 0],
+                ];
+            }
+        } else {
+            //石头花艺的德邦不需要收运费
+            if ($mainId == 644 && $category == 'transCost') {
+                $respond = [
+                    ['sign' => 0, 'perKiloCost' => 5],
+                    ['sign' => 1, 'perKiloCost' => 0],
+                    ['sign' => 2, 'option' => [['num' => 20, 'amount' => 50], ['num' => 30, 'amount' => 80], ['num' => 50, 'amount' => 120], ['num' => 70, 'amount' => 180], ['num' => 100, 'amount' => 200]]],
+                    ['sign' => 3, 'perKiloCost' => 4],
+                    ['sign' => 4, 'perKiloCost' => 0],
+                    ['sign' => 5, 'perKiloCost' => 0],
+                ];
+            }
+        }
+
         return $respond;
     }
 
     //列出所有的常量 ssh 2021.3.18
-    public static function get()
+    public static function get($mainId = 0)
     {
         $respond = self::$data;
         //根据环境获取小程序原始ID
@@ -514,6 +541,32 @@ class dict
         if (getenv('YII_ENV') != 'production') {
             $respond['hdMiniMessage'] = $respond['hdMiniMessageDev'];
         }
+
+        if (getenv('YII_ENV') == 'production') {
+            //老油云漫梦金鹏的德邦不需要收运费
+            if ($mainId == 20528) {
+                $respond['transCost'] = [
+                    ['sign' => 0, 'perKiloCost' => 5],
+                    ['sign' => 1, 'perKiloCost' => 0],
+                    ['sign' => 2, 'option' => [['num' => 20, 'amount' => 50], ['num' => 30, 'amount' => 80], ['num' => 50, 'amount' => 120], ['num' => 70, 'amount' => 180], ['num' => 100, 'amount' => 200]]],
+                    ['sign' => 3, 'perKiloCost' => 4],
+                    ['sign' => 4, 'perKiloCost' => 0],
+                    ['sign' => 5, 'perKiloCost' => 0],
+                ];
+            }
+        } else {
+            //石头花艺的德邦不需要收运费
+            if ($mainId == 644) {
+                $respond['transCost'] = [
+                    ['sign' => 0, 'perKiloCost' => 5],
+                    ['sign' => 1, 'perKiloCost' => 0],
+                    ['sign' => 2, 'option' => [['num' => 20, 'amount' => 50], ['num' => 30, 'amount' => 80], ['num' => 50, 'amount' => 120], ['num' => 70, 'amount' => 180], ['num' => 100, 'amount' => 200]]],
+                    ['sign' => 3, 'perKiloCost' => 4],
+                    ['sign' => 4, 'perKiloCost' => 0],
+                    ['sign' => 5, 'perKiloCost' => 0],
+                ];
+            }
+        }
         return $respond;
     }