123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <?php
- $option = array
- (
- 'text' => '文本',
- 'voice' => '语音',
- 'video' => '视频',
- 'image' => '图片',
- 'event' => '事件',
- 'subscribe' => '订阅',
- 'unsubscribe' => '取消订阅',
- 'SCAN' => '扫描二维码',
- 'location' => '地址位置',
- 'CLICK' => '菜单点击',
- 'VIEW' => '菜单跳转',
- 'MASSSENDJOBFINISH' => '后台群发',
- //'TEMPLATESENDJOBFINISH' => '模板消息',
- );
- return array
- (
- # 表名
- 'name' => 'usermsg',
- # 显示给用户看的名称
- 'lang' => '消息列表',
- //'desc' => '注:这里面只保存了近一个月的数据,请注意!',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- ),
- 'site' => array
- (
- 'type' => 'int-11',
- 'name' => '站点',
- 'default' => '',
- 'desc' => '请输入站点',
- 'match' => 'is_numeric',
-
- ),
-
- 'from' => array
- (
- 'type' => 'varchar-100',
- 'name' => '用户',
- 'default' => '',
- 'desc' => '用户',
- 'search' => 'fulltext',
- 'list' => 'Dever::load("weixin/user.name", "{from}")',
- 'match' => 'option',
- ),
- 'to' => array
- (
- 'type' => 'varchar-100',
- 'name' => '接收人',
- 'default' => '',
- 'desc' => '接收人',
- 'search' => 'fulltext',
- //'list' => true,
- 'match' => 'option',
- ),
-
- 'type' => array
- (
- 'type' => 'varchar-20',
- 'name' => '消息类型',
- 'default' => '',
- 'desc' => '发送类型',
- 'search' => 'select',
- 'list' => true,
- 'option' => $option,
- 'match' => 'option',
- 'show' => 'yes',
- ),
-
- 'mid' => array
- (
- 'type' => 'bigint-11',
- 'name' => '消息id',
- 'default' => '',
- 'desc' => '消息id',
- 'search' => 'fulltext',
- //'list' => true,
- 'match' => 'option',
- ),
-
- 'info' => array
- (
- 'type' => 'text-255',
- 'name' => '消息内容',
- 'default' => '',
- 'desc' => '消息内容',
- 'search' => 'fulltext',
- 'list' => 'Dever::load("weixin/user.msg", {id})',
- 'match' => 'option',
- ),
-
- 'ctime' => array
- (
- 'type' => 'int-11',
- 'name' => '发送时间',
- 'desc' => '',
- 'match' => 'option',
- 'list' => 'date("Y-m-d H:i:s", {ctime})',
- ),
-
- 'content' => array
- (
- 'type' => 'text-255',
- 'name' => '事件',
- 'default' => '',
- 'desc' => '事件',
- 'list' => 'table',
- 'decode' => true,
- 'modal' => '查看详情',
- 'match' => 'option',
- ),
- 'reply' => array
- (
- 'type' => 'text-255',
- 'name' => '系统回复',
- 'default' => '',
- 'desc' => '回复',
- 'list' => 'Dever::load("weixin/account.button", {id})',
- //'modal' => '点此查看',
- 'match' => 'option',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- ),
- ),
-
- 'manage' => array
- (
- 'desc' => '注:这里的记录为用户发送给本公众号的消息',
- ),
- 'auth' => 'site',
-
- # request 请求接口定义
- 'request' => array
- (
- 'getOne' => array
- (
- # 匹配的正则或函数 必填项
- 'where' => array
- (
- 'mid' => 'yes',
- 'site' => 'yes',
- ),
- 'type' => 'one',
- ),
-
- # 获取一个用户最新的记录
- 'getNew' => array
- (
- # 匹配的正则或函数 必填项
- 'where' => array
- (
- 'from' => 'yes',
- 'site' => 'yes',
- ),
- 'type' => 'one',
- 'order' => array('ctime', 'desc'),
- ),
- # 获取能被用来聊天的数据
- 'getAll' => array
- (
- # 匹配的正则或函数 必填项
- 'where' => array
- (
- 'from' => 'yes',
- 'site' => 'yes',
- //'type' => array('"text","image"', 'in'),
- ),
- 'type' => 'all',
- 'order' => array('ctime', 'desc'),
- 'page' => array(10, 'list'),
- 'col' => '*',
- ),
- ## 获取前一个月的用户消息数据
- 'getTimeData' => array(
- 'where' => array
- (
- //'cdate' => 'yes',
- 'cdate' => array('1', '<='),
- ),
- 'limit'=> 'yes',
- 'type' => 'all',
- 'order' => array('cdate', 'desc'),
- 'col' => '*',
- )
- ),
- );
|