123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- /**
- * user
- */
-
- # 定义几个常用的选项
- $option = array
- (
- 1 => '正常',
- 2 => '不可用',
- );
- return array
- (
- # 表名
- 'name' => 'site',
- # 显示给用户看的名称
- 'lang' => '站点配置',
- 'order' => 100,
- 'desc' => '服务器地址:'.Dever::url('weixin/service.push?site=?').' 问号请替换成id',
- 'end' => array
- (
- 'insert' => 'manage/top.sync',
- 'update' => 'manage/top.sync',
- ),
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- ),
- 'name' => array
- (
- 'type' => 'varchar-50',
- 'name' => '站点名称',
- 'default' => '',
- 'desc' => '请输入站点名称',
- 'match' => 'is_string',
- 'search' => 'fulltext',
- 'update' => 'text',
- 'list' => true,
- ),
-
- 'site' => array
- (
- 'type' => 'varchar-100',
- 'name' => '站点网址',
- 'default' => '',
- 'desc' => '请输入站点网址',
- 'match' => 'is_string',
- 'search' => 'order,fulltext',
- 'update' => 'text',
- 'list' => true,
- ),
- 'weixin' => array
- (
- 'type' => 'varchar-100',
- 'name' => '微信号',
- 'default' => '',
- 'desc' => '请输入微信号',
- 'match' => 'is_string',
- 'search' => 'order,fulltext',
- 'update' => 'text',
- 'list' => true,
- ),
-
- 'appid' => array
- (
- 'type' => 'varchar-150',
- 'name' => '微信appid',
- 'default' => '',
- 'desc' => '请输入微信appid',
- 'match' => 'is_string',
- 'search' => 'order,fulltext',
- 'update' => 'text',
- 'list' => 'table',
- 'modal' => '详细信息',
- ),
- 'secret' => array
- (
- 'type' => 'varchar-150',
- 'name' => '微信secret',
- 'default' => '',
- 'desc' => '请输入微信secret',
- 'match' => 'is_string',
- 'search' => 'order,fulltext',
- 'update' => 'text',
- //'list' => 'table',
- //'modal' => '详细信息',
- ),
- 'token' => array
- (
- 'type' => 'varchar-150',
- 'name' => '通信token(注意不是access_token)',
- 'default' => '',
- 'desc' => '请输入通信token',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'key' => array
- (
- 'type' => 'varchar-150',
- 'name' => '消息加解密密钥',
- 'default' => '',
- 'desc' => '请输入消息加解密密钥',
- 'match' => 'option',
- 'update' => 'text',
- ),
-
- '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,
- ),
- ),
- # 更新表结构
- 'alter' => array
- (
- 1 => array
- (
- array('add', 'weixin', 'weixin', 'varchar-100 微信号'),
- ),
- 'version' => 1,
- ),
-
- 'manage' => array
- (
- //'insert' => false,
- //'list_button' => array(6 => '加入到cron'),
- 'button' => array
- (
- //'重新同步' => 'manage/api.update',
- )
- ),
- # 后台新增功能,权限精细控制 加入到头部右侧可选菜单中
- 'auth' => array
- (
- # 数据来源
- 'data' => 'getAll',
- # 菜单名
- 'name' => '站点选择',
- # 默认值
- 'value' => 1,
- # 对应的字段值,设置这个之后,所有设置auth等于这个值的字段,都要遵循这个权限的控制
- 'key' => 'site',
- # 本表中代表名称的字段
- 'col' => 'name',
- ),
-
- 'request' => array
- (
- 'getAll' => array
- (
- 'where' => array
- (
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id', 'desc'),
- 'col' => '*|id',
- ),
- ),
- );
|