Explorar el Código

ComposerUpdate

Anyon hace 5 años
padre
commit
d0cf1d390e

+ 2 - 0
app/admin/controller/Auth.php

@@ -17,6 +17,7 @@ namespace app\admin\controller;
 
 use think\admin\Controller;
 use think\admin\service\AdminService;
+use app\wechat\service\WechatService;
 
 /**
  * 系统权限管理
@@ -80,6 +81,7 @@ class Auth extends Controller
      */
     public function state()
     {
+       
         $this->_applyFormToken();
         $this->_save($this->table, ['status' => input('status')]);
     }

+ 1 - 0
app/wechat/service/WechatService.php

@@ -62,6 +62,7 @@ use think\exception\HttpResponseException;
  * @method \WeMini\Soter WeMiniSoter() static 小程序生物认证
  * @method \WeMini\Template WeMiniTemplate() static 小程序模板消息支持
  * @method \WeMini\Total WeMiniTotal() static 小程序数据接口
+ * @method \WeMini\Newtmpl WeminiNewtmpl() static 小程序订阅消息支持
  *
  * ----- WePay -----
  * @method \WePay\Bill WePayBill() static 微信商户账单及评论

+ 5 - 5
composer.lock

@@ -962,16 +962,16 @@
         },
         {
             "name": "zoujingli/wechat-developer",
-            "version": "v1.2.15",
+            "version": "v1.2.16",
             "source": {
                 "type": "git",
                 "url": "https://github.com/zoujingli/WeChatDeveloper.git",
-                "reference": "4b81e72cff7a3acfde2cca919bd8e173355bc53c"
+                "reference": "01fa1479e8c4d7a0875de96787a2bcaeacc755e9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/4b81e72cff7a3acfde2cca919bd8e173355bc53c",
-                "reference": "4b81e72cff7a3acfde2cca919bd8e173355bc53c",
+                "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/01fa1479e8c4d7a0875de96787a2bcaeacc755e9",
+                "reference": "01fa1479e8c4d7a0875de96787a2bcaeacc755e9",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1022,7 +1022,7 @@
                 "wechatpay",
                 "wepay"
             ],
-            "time": "2019-11-25T10:40:50+00:00"
+            "time": "2020-01-04T08:51:50+00:00"
         }
     ],
     "packages-dev": [],

+ 0 - 7
nbproject/project.properties

@@ -1,7 +0,0 @@
-include.path=${php.global.include.path}
-php.version=PHP_74
-source.encoding=UTF-8
-src.dir=.
-tags.asp=false
-tags.short=false
-web.root=.

+ 0 - 9
nbproject/project.xml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
-    <type>org.netbeans.modules.php.project</type>
-    <configuration>
-        <data xmlns="http://www.netbeans.org/ns/php-project/1">
-            <name>thinkadmin</name>
-        </data>
-    </configuration>
-</project>

+ 1 - 0
vendor/composer/autoload_classmap.php

@@ -164,6 +164,7 @@ return array(
     'WeMini\\Image' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Image.php',
     'WeMini\\Logistics' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Logistics.php',
     'WeMini\\Message' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Message.php',
+    'WeMini\\Newtmpl' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Newtmpl.php',
     'WeMini\\Ocr' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Ocr.php',
     'WeMini\\Plugs' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Plugs.php',
     'WeMini\\Poi' => $vendorDir . '/zoujingli/wechat-developer/WeMini/Poi.php',

+ 1 - 0
vendor/composer/autoload_static.php

@@ -297,6 +297,7 @@ class ComposerStaticInit2b1316f37dd8fe5c4c25969e0b842e8e
         'WeMini\\Image' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Image.php',
         'WeMini\\Logistics' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Logistics.php',
         'WeMini\\Message' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Message.php',
+        'WeMini\\Newtmpl' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Newtmpl.php',
         'WeMini\\Ocr' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Ocr.php',
         'WeMini\\Plugs' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Plugs.php',
         'WeMini\\Poi' => __DIR__ . '/..' . '/zoujingli/wechat-developer/WeMini/Poi.php',

+ 6 - 6
vendor/composer/installed.json

@@ -989,17 +989,17 @@
     },
     {
         "name": "zoujingli/wechat-developer",
-        "version": "v1.2.15",
-        "version_normalized": "1.2.15.0",
+        "version": "v1.2.16",
+        "version_normalized": "1.2.16.0",
         "source": {
             "type": "git",
             "url": "https://github.com/zoujingli/WeChatDeveloper.git",
-            "reference": "4b81e72cff7a3acfde2cca919bd8e173355bc53c"
+            "reference": "01fa1479e8c4d7a0875de96787a2bcaeacc755e9"
         },
         "dist": {
             "type": "zip",
-            "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/4b81e72cff7a3acfde2cca919bd8e173355bc53c",
-            "reference": "4b81e72cff7a3acfde2cca919bd8e173355bc53c",
+            "url": "https://api.github.com/repos/zoujingli/WeChatDeveloper/zipball/01fa1479e8c4d7a0875de96787a2bcaeacc755e9",
+            "reference": "01fa1479e8c4d7a0875de96787a2bcaeacc755e9",
             "shasum": "",
             "mirrors": [
                 {
@@ -1017,7 +1017,7 @@
             "ext-simplexml": "*",
             "php": ">=5.4"
         },
-        "time": "2019-11-25T10:40:50+00:00",
+        "time": "2020-01-04T08:51:50+00:00",
         "type": "library",
         "installation-source": "dist",
         "autoload": {

+ 1 - 1
vendor/services.php

@@ -1,5 +1,5 @@
 <?php 
-// This file is automatically generated at:2020-01-04 15:12:03
+// This file is automatically generated at:2020-01-04 17:03:01
 declare (strict_types = 1);
 return array (
   0 => 'think\\app\\Service',

+ 151 - 0
vendor/zoujingli/wechat-developer/WeMini/Newtmpl.php

@@ -0,0 +1,151 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | WeChatDeveloper
+// +----------------------------------------------------------------------
+// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// +----------------------------------------------------------------------
+// | 官方网站: http://think.ctolog.com
+// +----------------------------------------------------------------------
+// | 开源协议 ( https://mit-license.org )
+// +----------------------------------------------------------------------
+// | github开源项目:https://github.com/zoujingli/WeChatDeveloper
+// +----------------------------------------------------------------------
+
+namespace WeMini;
+
+use WeChat\Contracts\BasicWeChat;
+
+/**
+ * 公众号小程序订阅消息支持
+ * Class Mini
+ * @package WeChat
+ */
+class Newtmpl extends BasicWeChat
+{
+    /**
+     * 获取小程序账号的类目
+     * @param array $data 类目信息列表
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function addCategory($data)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/addcategory?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, $data, true);
+    }
+
+    /**
+     * 获取小程序账号的类目
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getCategory()
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getcategory?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callGetApi($url);
+    }
+
+    /**
+     * 获取小程序账号的类目
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function deleteCategory()
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory?access_token=TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, [], true);
+    }
+
+    /**
+     * 获取帐号所属类目下的公共模板标题
+     * @param string $ids 类目 id,多个用逗号隔开
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getPubTemplateTitleList($ids)
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatetitles?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['ids'=>$ids,'start' => '0', 'limit' => '30'], true);
+    }
+
+    /**
+     * 获取模板标题下的关键词列表
+     * @param string $tid 模板标题 id,可通过接口获取
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getPubTemplateKeyWordsById($tid)
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/getpubtemplatekeywords?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['tid' => $tid], true);
+    }
+
+    /**
+     * 组合模板并添加至帐号下的个人模板库
+     * @param string $tid 模板标题 id,可通过接口获取,也可登录小程序后台查看获取
+     * @param array $kidList 开发者自行组合好的模板关键词列表,关键词顺序可以自由搭配(例如 [3,5,4] 或 [4,5,3]),最多支持5个,最少2个关键词组合
+     * @param string $sceneDesc 服务场景描述,15个字以内
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function addTemplate($tid, array $kidList, $sceneDesc = '')
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['tid' => $tid, 'kidList' => $kidList, 'sceneDesc' => $sceneDesc], false);
+    }
+
+    /**
+     * 获取当前帐号下的个人模板列表
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function getTemplateList()
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, [], true);
+    }
+
+    /**
+     * 删除帐号下的个人模板
+     * @param string $priTmplId 要删除的模板id
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function delTemplate($priTmplId)
+    {
+        $url = 'https://api.weixin.qq.com/wxaapi/newtmpl/deltemplate?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, ['priTmplId' => $priTmplId], true);
+    }
+
+    /**
+     * 发送订阅消息
+     * @param array $data 发送的消息对象数组
+     * @return array
+     * @throws \WeChat\Exceptions\InvalidResponseException
+     * @throws \WeChat\Exceptions\LocalCacheException
+     */
+    public function send(array $data)
+    {
+        $url = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN';
+        $this->registerApi($url, __FUNCTION__, func_get_args());
+        return $this->callPostApi($url, $data, true);
+    }
+
+}