Bladeren bron

新增公共包判断方法

wangzq 2 jaren geleden
bovenliggende
commit
ee9669548d
2 gewijzigde bestanden met toevoegingen van 43 en 0 verwijderingen
  1. 22 0
      app/Libs/Helpers.php
  2. 21 0
      config/package.php

+ 22 - 0
app/Libs/Helpers.php

@@ -866,4 +866,26 @@ if (!function_exists("check_qapp_send_order_id)")){
 
         return true;
     }
+}
+
+/**
+ *  判断包是否是公共包
+ * name: is_public_package
+ * @param string $packageName
+ * @return bool
+ * date 2022/09/22 16:53
+ */
+if(!function_exists("is_public_package")){
+    function is_public_package($packageName = "")
+    {
+        if (empty($packageName)){
+            return false;
+        }
+        $publicPackageName = config("package.package_name");
+        if (in_array($packageName,$publicPackageName)){
+            return  true;
+        }
+
+        return  false;
+    }
 }

+ 21 - 0
config/package.php

@@ -0,0 +1,21 @@
+<?php
+/**
+ *  公共包配置
+ * @file:package.php
+ * @Created by gnitif
+ * @Date: 2022/9/22
+ * @Time: 16:36
+ */
+
+return [
+    // 包名
+    "package_name" =>  [
+        "com.beidao.kuaiying.zsy",
+        "com.beidao.kuaiying.qingmang",
+    ],
+    // 站点id
+    'channel_id' =>  [
+        7477,
+        13131,
+    ],
+];