123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <?php
- $config = array();
- $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'interface' . DIRECTORY_SEPARATOR;
- # 载入素材配置
- $config += include($path . 'media.php');
- # 载入素材配置
- $config += include($path . 'message.php');
- # 载入菜单配置
- $config += include($path . 'menu.php');
- # 载入二维码配置
- $config += include($path . 'code.php');
- # 载入统计配置
- $config += include($path . 'stat.php');
- # 数据收集的配置
- $config += array
- (
- # 获取分组
- 'user_group' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/groups/get?',
- 'param' => array
- (
- 'access_token' => 'token',
- ),
- # 对结果的后续操作
- 'action' => array
- (
- # 数据来源来openid
- 'data' => 'groups',
-
- # 根据哪个字段读取数据
- 'where' => array
- (
- # 这边的字段,对应微信的字段,如果相同就不用写key
- 'groupid' => 'id',
- ),
- 'update' => array
- (
- # 微信的字段,对应这边哪个字段,如果相同这里就不用加了。与上边正好相反,注意。
- 'id' => 'groupid',
- ),
- # 更新到哪个表中
- 'table' => 'group',
- ),
- ),
-
- # 创建分组
- 'group_create' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/groups/create?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'group' => array('name' => urlencode(Dever::input('update_name'))),
- ),
- # json 传输
- 'json' => true,
-
- 'action' => array
- (
- 'data' => 'group',
-
- 'where' => array
- (
- 'groupid' => 'id',
- ),
- 'update' => array
- (
- 'id' => 'groupid',
- ),
- 'table' => 'group',
- ),
- ),
-
- # 更新分组
- 'group_edit' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/groups/update?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'group' => array('id' => Dever::input('update_groupid'), 'name' => Dever::input('update_name')),
- ),
- 'json' => true,
- ),
-
- # 删除分组
- 'group_delete' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/groups/delete?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'group' => array('id' => Dever::input('group')),
- ),
- 'json' => true,
- ),
-
- # 移动用户分组
- 'group_move' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/groups/members/update?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'openid' => Dever::input('openid'),
- 'to_groupid' => Dever::input('to_groupid'),
- ),
- 'json' => true,
- ),
-
- # 获取用户list
- 'user_list' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/user/get?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'next_openid' => '',
- ),
-
- # 对结果的后续操作
- 'action' => array
- (
- # 数据来源来openid
- 'data' => 'openid',
- # 调取的方法为user_info
- 'method' => 'user_info',
- ),
- ),
-
- # 获取用户基本信息
- 'user_info' => array
- (
- 'url' => 'https://api.weixin.qq.com/cgi-bin/user/info?',
- 'param' => array
- (
- 'access_token' => 'token',
- 'openid' => Dever::input('openid') ? Dever::input('openid') : 'openid',
- 'lang' => 'zh_CN'
- ),
-
- # 对结果的后续操作
- 'action' => array
- (
- # 根据哪个字段读取数据
- 'where' => array('openid'),
- # 更新到哪个表中
- 'table' => 'user',
- ),
- ),
- );
- return $config;
|