123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- /**
- * user
- */
-
- # 定义几个常用的选项
- $option = array
- (
- 1 => '正常',
- 2 => '删除',
- );
- return array
- (
- # 表名
- 'name' => 'group',
- # 显示给用户看的名称
- 'lang' => '分组管理',
- 'desc' => '删除分组请慎重,我们这里做了限制,如果组内有用户,则不允许删除。另外星标组和黑名单无法改名。可加入到cron中:data.user_group?site=? site后的问号请替换为站点id',
- 'end' => array
- (
- # 创建分组到微信
- 'insert' => 'weixin/data.group_create',
- # 更新分组到微信
- 'update' => 'weixin/data.group_edit',
- ),
-
- 'start' => array
- (
- # 删除分组
- 'delete' => 'weixin/user.delete_group',
- ),
-
- # 数据结构
- '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',
- //'search' => 'order,fulltext',
- //'update' => 'text',
- //'list' => true,
- ),
-
- 'groupid' => array
- (
- 'type' => 'int-11',
- 'name' => '微信组id',
- 'default' => '',
- 'desc' => '请输入微信组id',
- 'match' => 'is_numeric',
- 'search' => 'order,fulltext',
- 'update' => 'hidden',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-50',
- 'name' => '组名',
- 'default' => '',
- 'desc' => '请输入组名',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'update' => 'text',
- 'list' => true,
- ),
-
- 'count' => array
- (
- 'type' => 'int-11',
- 'name' => '组内用户数',
- 'default' => '',
- 'desc' => '请输入组内用户数',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'update' => 'text',
- 'list' => true,
- ),
-
- 'mdate' => array
- (
- 'type' => 'int-11',
- 'name' => '更新时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- ),
-
- '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,
- ),
- ),
-
- 'manage' => array
- (
- //'insert' => false,
- 'list_button' => array(1 => array('用户', '"user&option_groupid={groupid}"'), 6 => '删除',),
- 'button' => array
- (
- '重新同步' => 'weixin/data.user_group',
- )
- ),
- 'auth' => 'site',
-
- # request 请求接口定义
- 'request' => array
- (
- # 根据hash取一条数据
- 'info' => array
- (
- # 匹配的正则或函数 必填项
- 'where' => array
- (
- 'groupid' => 'yes',
- 'site' => 'yes',
- ),
- 'type' => 'one',
- ),
-
- 'main' => array
- (
- 'where' => array
- (
- 'state' => 1,
- 'site' => 'yes',
- ),
- 'type' => 'all',
- 'order' => array('id', 'desc'),
- 'col' => '*|groupid',
- ),
- 'get' => array
- (
- 'where' => array
- (
- 'state' => 1,
- 'site' => 'yes',
- ),
- 'type' => 'all',
- 'order' => array('id', 'desc'),
- 'col' => 'name,groupid as id,groupid|groupid',
- ),
-
- # 更新数量
- 'upNum' => array
- (
- 'type' => 'update',
- 'where' => array
- (
- 'groupid' => 'yes',
- 'site' => 'yes',
- ),
- 'set' => array
- (
- 'count' => array('yes', '+='),
- ),
- ),
- ),
- );
|