group.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | role.php 角色表
  5. |--------------------------------------------------------------------------
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '可用',
  11. 2 => '不可用',
  12. );
  13. $area = function()
  14. {
  15. return Dever::load('setting/area-getAll', array('where_area_id_parent' => 0));
  16. };
  17. $config = array
  18. (
  19. # 表名
  20. 'name' => 'group',
  21. # 显示给用户看的名称
  22. 'lang' => '管理组设置',
  23. 'order' => 8,
  24. # 表类型 值为\innodb\myisam\,默认为innodb,仅在mysql类型有效
  25. 'type' => 'innodb',
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '组ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'list' => true,
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-50',
  42. 'name' => '组名称',
  43. 'default' => '',
  44. 'desc' => '请输入组名称',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'fulltext',
  48. //'list_name' => '角色名',//定义列表页的名称
  49. 'list' => true,
  50. 'edit' => true,
  51. ),
  52. 'area' => array
  53. (
  54. 'type' => 'varchar-255',
  55. 'name' => '区域',
  56. 'default' => '',
  57. 'desc' => '请选择区域',
  58. 'match' => 'option',
  59. 'update' => 'checkbox',
  60. 'option' => $area,
  61. ),
  62. 'state' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '状态',
  66. 'default' => '1',
  67. 'desc' => '请选择状态',
  68. 'match' => 'is_numeric',
  69. 'option' => $option,
  70. 'update' => 'radio',
  71. 'search' => 'select',
  72. 'list' => true,
  73. 'edit' => true,
  74. ),
  75. 'cdate' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '录入时间',
  79. 'match' => array('is_numeric', DEVER_TIME),
  80. 'desc' => '',
  81. # 只有insert时才生效
  82. 'insert' => true,
  83. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  84. ),
  85. ),
  86. # 默认值
  87. 'default' => array
  88. (
  89. 'col' => 'name,state,cdate',
  90. 'value' => array
  91. (
  92. '"默认分组",1,' . DEVER_TIME,
  93. ),
  94. ),
  95. # 后台管理 此处的功能全部开放
  96. 'manage' => array
  97. (
  98. ),
  99. );
  100. return $config;