set.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. # 定义几个常用的选项
  3. $type = array
  4. (
  5. 1 => '固定值',
  6. 2 => '自增值',
  7. 3 => '公式算法',
  8. 4 => '区间随机值',
  9. 5 => '时间随机值',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'set',
  15. # 显示给用户看的名称
  16. 'lang' => '自定义字段管理',
  17. 'menu' => false,
  18. # 后台菜单排序
  19. 'order' => 7,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. 'list' => true,
  32. 'order' => 'desc',
  33. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-100',
  37. 'name' => '字段名称',
  38. 'default' => '',
  39. 'desc' => '字段名称',
  40. 'match' => 'is_string',
  41. 'update' => 'text',
  42. 'search' => 'fulltext',
  43. 'list' => true,
  44. 'edit' => true,
  45. ),
  46. 'key' => array
  47. (
  48. 'type' => 'varchar-100',
  49. 'name' => '字段唯一标识符',
  50. 'default' => '',
  51. 'desc' => '字段唯一标识符',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. 'search' => 'fulltext',
  55. 'list' => true,
  56. 'edit' => true,
  57. ),
  58. 'pid' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '项目id',
  62. 'default' => Dever::input('search_option_pid', -1),
  63. 'desc' => '请选择项目id',
  64. 'match' => 'is_numeric',
  65. 'search' => 'order',
  66. 'update' => 'hidden',
  67. ),
  68. 'type' => array
  69. (
  70. 'type' => 'tinyint-1',
  71. 'name' => '字段类型',
  72. 'default' => '1',
  73. 'desc' => '字段类型',
  74. 'match' => 'is_numeric',
  75. 'option' => $type,
  76. 'update' => 'radio',
  77. 'list' => true,
  78. 'control' => 'type',
  79. ),
  80. 'value' => array
  81. (
  82. 'type' => 'varchar-2000',
  83. 'name' => '字段值-如果是区间随机值和时间随机值,第一行就是最小值,第二行就是最大值',
  84. 'default' => '',
  85. 'desc' => '字段值',
  86. 'match' => 'is_string',
  87. 'update' => 'textarea',
  88. 'list' => true,
  89. 'edit' => 'textarea',
  90. ),
  91. 'state' => array
  92. (
  93. 'type' => 'tinyint-1',
  94. 'name' => '数据状态',
  95. 'default' => '1',
  96. 'desc' => '请选择状态',
  97. 'match' => 'is_numeric',
  98. ),
  99. 'cdate' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '录入时间',
  103. 'match' => array('is_numeric', time()),
  104. 'desc' => '',
  105. # 只有insert时才生效
  106. 'insert' => true,
  107. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  108. ),
  109. ),
  110. 'request' => array
  111. (
  112. 'getList' => array
  113. (
  114. 'where' => array
  115. (
  116. 'pid' => 'yes',
  117. 'state' => 1,
  118. ),
  119. 'type' => 'all',
  120. 'order' => array
  121. (
  122. 'id' => 'desc',
  123. ),
  124. 'col' => '*|key',
  125. ),
  126. )
  127. );