浏览代码

根据环境获取小程序原始ID

shish 4 年之前
父节点
当前提交
d718d50280
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      common/components/dict.php

+ 19 - 0
common/components/dict.php

@@ -8,6 +8,14 @@ class dict
 {
 
     public static $data = [
+
+        //小程序原始ID
+        'miniOriginalId' => [
+            'dev' => ['mall' => 'gh_071ff9f39df6', 'hd' => 'gh_177befc881cb', 'ghs' => 'gh_2a429284375a', 'jd' => '',],
+            'product' => ['mall' => 'gh_38f1a1af64ca', 'hd' => 'gh_73b8b357d19a', 'ghs' => 'gh_2e886744af66', 'jd' => '',],
+            'current' => ['mall' => '', 'hd' => '', 'ghs' => '', 'jd' => '',],
+        ],
+
         //是否需要打印
         'needPrint' => [
             'need' => 1,
@@ -345,6 +353,17 @@ class dict
     public static function get()
     {
         $respond = self::$data;
+
+        //根据环境获取小程序原始ID
+        if (isset($respond['miniOriginalId']['dev'])) {
+            $respond['miniOriginalId']['current'] = $respond['miniOriginalId']['dev'];
+        }
+        if (getenv('YII_ENV') == 'production') {
+            if (isset($respond['miniOriginalId']['product'])) {
+                $respond['miniOriginalId']['current'] = $respond['miniOriginalId']['product'];
+            }
+        }
+
         return $respond;
     }