123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <?php
- # 常用的col
- $col = '*';
- $is_project = array
- (
- 1 => '全部可用',
- 2 => '部分可用',
- );
- $project = function()
- {
- $array = array();
- $data = Dever::db('manage/menu_group')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- return array
- (
- # 表名
- 'name' => 'company',
- # 显示给用户看的名称
- 'lang' => '公司管理',
- 'order' => 7,
- 'menu' => false,
- //'auto' => 10000000,
- 'end' => array
- (
- 'update' => 'manage/company.update',
- ),
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-80',
- 'name' => '公司名称',
- 'default' => '',
- 'desc' => '公司名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
- 'search' => 'fulltext',
- ),
- 'is_project' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '项目可用状态',
- 'default' => '1',
- 'desc' => '项目可用状态',
- 'match' => 'is_numeric',
- 'option' => $is_project,
- 'update' => 'radio',
- 'list' => true,
- 'control' => 'is_project',
- ),
- 'project' => array
- (
- 'type' => 'varchar-2000',
- 'name' => '可用项目',
- 'default' => '',
- 'desc' => '选择项目',
- 'match' => 'is_string',
- 'option' => $project,
- 'update' => 'checkbox',
- 'show' => 'is_project=2',
- //'list' => true,
- ),
- 'manage/group'=> array
- (
- 'name' => '部门设置',
- 'default' => '',
- 'desc' => '部门设置',
- 'match' => 'option',
- # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
- 'sync' => array('company_id' => 'id'),
- 'update' => array(1),
- 'update_type' => 2,
- ),
-
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i", {cdate})',
- ),
- ),
- 'default' => array
- (
- 'col' => 'id,name,state,cdate',
- 'value' => array
- (
- '1,"默认公司", 1,' . DEVER_TIME,
- ),
- ),
-
- # 管理功能
- 'manage' => array
- (
- 'insert_check' => 'manage/group',
- 'update_check' => 'manage/group',
- 'delete' => false,
- 'insert' => false,
- 'edit' => false,
- # 自定义快捷新增和编辑
- 'button' => array
- (
- '新增' => array('fast'),
- ),
- # 快捷更新
- 'list_button' => array
- (
- 'edit' => array('编辑'),
- ),
- ),
- 'request' => array
- (
- 'getIds' => array
- (
- 'type' => 'all',
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'desc'),
- 'col' => '*|id',
- ),
- 'getOld' => array
- (
- 'type' => 'all',
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'asc'),
- 'col' => '*',
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'noid' => array('yes-id', 'not in'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => 'id,id as value, name',
- ),
- ),
- );
|