group.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. ),
  70. 'cdate' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '录入时间',
  74. 'match' => array('is_numeric', DEVER_TIME),
  75. 'desc' => '',
  76. # 只有insert时才生效
  77. 'insert' => true,
  78. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  79. ),
  80. ),
  81. # 默认值
  82. 'default' => array
  83. (
  84. 'col' => 'name,state,cdate',
  85. 'value' => array
  86. (
  87. '"默认分组",1,' . DEVER_TIME,
  88. ),
  89. ),
  90. # 后台管理 此处的功能全部开放
  91. 'manage' => array
  92. (
  93. ),
  94. );
  95. return $config;