Bladeren bron

平台信息

shish 5 jaren geleden
bovenliggende
commit
dcf451c3d0
1 gewijzigde bestanden met toevoegingen van 25 en 25 verwijderingen
  1. 25 25
      common/components/miniUtil.php

+ 25 - 25
common/components/miniUtil.php

@@ -368,13 +368,13 @@ class miniUtil
 
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台');
@@ -396,13 +396,13 @@ class miniUtil
 
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台');
@@ -480,9 +480,9 @@ class miniUtil
     }
 
     //客服接口发消息
-    public static function sendMsg($content, $merchant, $openId)
+    public static function sendMsg($content, $merchant, $openId, $isOpen)
     {
-        $token = self::getMiniProgramAccessToken($merchant);
+        $token = self::getMiniProgramAccessToken($merchant, $isOpen);
         $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={$token}";
         $data = ['touser' => $openId, 'msgtype' => 'text', 'text' => ['content' => $content]];
         $curl = new curl\Curl();
@@ -608,13 +608,13 @@ class miniUtil
 
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台');
@@ -641,19 +641,19 @@ class miniUtil
                 $uData['wxAccessToken'] = $authorize_access_token;
                 $uData['wxAccessTokenTime'] = date("Y-m-d H:i:s", (time() + $expires_in - 100));
                 if ($isOpen == 1) {
-                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
                     $wxBaseId = isset($open['wxBaseId']) ? $open['wxBaseId'] : 0;
                     if (!empty($wxBaseId)) {
                         WxBaseService::updateById($wxBaseId, $uData);
                     }
                 } elseif ($isOpen == 2) {
-                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
                     $wxBaseId = isset($open['wxBaseId']) ? $open['wxBaseId'] : 0;
                     if (!empty($wxBaseId)) {
                         WxBaseService::updateById($wxBaseId, $uData);
                     }
                 } elseif ($isOpen == 3) {
-                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+                    $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
                     $wxBaseId = isset($open['wxBaseId']) ? $open['wxBaseId'] : 0;
                     if (!empty($wxBaseId)) {
                         WxBaseService::updateById($wxBaseId, $uData);
@@ -678,13 +678,13 @@ class miniUtil
         //$id = dict::getDict('openId');
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台信息');
@@ -1379,13 +1379,13 @@ class miniUtil
         $name = isset($merchant['name']) ? $merchant['name'] : '';
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台');
@@ -1614,8 +1614,8 @@ class miniUtil
         file_put_contents($file, $result);
         //上传oss
         $obj = $behind . $fileName;
-        $obj = ltrim($obj,"/");
-        oss::uploadImage($obj,$file);
+        $obj = ltrim($obj, "/");
+        oss::uploadImage($obj, $file);
         return $behind . $fileName;
     }
 
@@ -1700,13 +1700,13 @@ class miniUtil
 
         $open = [];
         if ($isOpen == 1) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','hd')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'hd')]);
         }
         if ($isOpen == 2) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','ghs')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]);
         }
         if ($isOpen == 3) {
-            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle','mall')]);
+            $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]);
         }
         if (empty($open)) {
             util::fail('没有找到平台');