123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <?php
- /**
- * user
- */
-
- # 定义几个常用的选项
- $option = array
- (
- 1 => '待机',
- 2 => '运行中',
- 3 => '发送中',
- 4 => '完成',
- );
- $oper = array
- (
- 1 => '待机',
- 2 => '定时',
- 3 => '立刻发送',
- );
- $type = array
- (
- 1 => '订阅消息',
- 2 => '客服消息',
- );
- # 群发对象
- $user = array
- (
- 1 => '按分组选择',
- 2 => '指定openid',
- 3 => '指定uid',
- 4 => '所有用户',
- );
- # 分组
- $group = function()
- {
- $data = Dever::load('weixin/group-get');
- return $data;
- };
- # 订阅消息
- $get_1 = function()
- {
- $data = Dever::load('weixin/content-get_1');
- return $data;
- };
- # 客服消息
- $get_2 = function()
- {
- $data = Dever::load('weixin/content-get_2');
- return $data;
- };
- return array
- (
- # 表名
- 'name' => 'message',
- # 显示给用户看的名称
- 'lang' => '群发消息任务',
- 'order' => 18,
- 'end' => array
- (
- # 对oper的操作
- 'update_oper' => 'weixin/message.oper',
- 'insert' => 'weixin/message.oper',
- 'update' => 'weixin/message.oper',
- ),
- # 数据结构
- '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',
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-32',
- 'name' => '任务描述',
- 'default' => '',
- 'desc' => '请输入任务描述',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'update' => 'text',
- 'list' => true,
- ),
-
- 'oper' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '操作',
- 'default' => '1',
- 'desc' => '请选择操作',
- 'match' => 'is_numeric',
- 'option' => $oper,
- 'update' => 'radio',
- //'list' => true,
- # 开启显示控制,可以控制下边的表单
- 'show' => 'oper',
- ),
-
- 'sdate' => array
- (
- 'type' => 'int-11',
- 'name' => '发送时间',
- 'match' => 'option',
- 'default' => '0',
- 'desc' => '请输入发送时间',
- 'update' => 'date',//date为详细时间
- 'list' => '{sdate} > 0 ? date("Y-m-d H:i:s", {sdate}) : "暂无"',
- 'callback' => 'maketime',
- 'show' => array('oper_2'),
- ),
-
- 'user' => array
- (
- 'type' => 'int-1',
- 'name' => '群发对象',
- 'default' => '1',
- 'desc' => '请选择群发对象',
- 'match' => 'is_numeric',
- 'option' => $user,
- 'update' => 'radio',
- # 开启显示控制,可以控制下边的表单
- 'show' => 'user',
- ),
-
- 'group' => array
- (
- 'type' => 'int-11',
- 'name' => '选择分组',
- 'default' => '-1',
- 'desc' => '请选择分组',
- 'match' => 'is_numeric',
- 'option' => $group,
- 'update' => 'radio',
- 'show' => array('user_1'),
- ),
-
- 'openid' => array
- (
- 'type' => 'text-255',
- 'name' => '填写openid(OpenID 最多10000个,换行分割)',
- 'default' => '',
- 'desc' => '请填写openid',
- 'match' => 'option',
- 'update' => 'textarea',
- 'show' => array('user_2'),
- ),
-
- 'uid' => array
- (
- 'type' => 'text-255',
- 'name' => '填写平台uid(换行分割)',
- 'default' => '',
- 'desc' => '请填写uid',
- 'match' => 'option',
- 'update' => 'textarea',
- 'show' => array('user_3'),
- ),
-
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '发送类型',
- 'default' => '1',
- 'desc' => '请选择发送类型',
- 'match' => 'is_numeric',
- 'option' => $type,
- 'update' => 'radio',
- 'list' => true,
- # 开启显示控制,可以控制下边的表单
- 'show' => 'type',
- ),
-
- 'content_1' => array
- (
- 'type' => 'int-11',
- 'name' => '选择消息内容',
- 'default' => '',
- 'desc' => '请选择选择消息内容',
- 'match' => 'is_numeric',
- 'option' => $get_1,
- 'update' => 'select',
- 'show' => array('type_1'),
- ),
-
- 'content_2' => array
- (
- 'type' => 'int-11',
- 'name' => '选择消息内容',
- 'default' => '',
- 'desc' => '请选择选择消息内容',
- 'match' => 'is_numeric',
- 'option' => $get_2,
- 'update' => 'select',
- 'show' => array('type_2'),
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => array('is_numeric', 1),
- 'option' => $option,
- //'update' => 'radio',
- 'list' => true,
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
-
- 'manage' => array
- (
- # 列表
- 'list' => array
- (
- array(1 => array('日志', '"message_log&option_message_id={id}"')),
- ),
- 'desc' => '订阅消息:订阅号用户可以每天可接收1条群发消息,服务号用户每月只能接收4条群发消息,多于4条的群发将对该用户发送失败。 注意,如果群发对象选择“所有用户”,消息会自动进入公众号历史消息列表。<br />客服消息:每天发送一次,如果发送的用户超过50w,则只能最多发送50w个用户,本消息只对48小时之内和公众号有过互动的关注用户有效。',
- ),
- 'auth' => 'site',
-
- # request 请求接口定义
- 'request' => array
- (
- 'info' => array
- (
- # 匹配的正则或函数 必填项
- 'where' => array
- (
- 'groupid' => 'yes',
- 'site' => 'yes',
- ),
- 'type' => 'one',
- ),
- ),
- );
|