col.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '正常',
  6. 2 => '删除',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'col',
  12. # 显示给用户看的名称
  13. 'lang' => '采集字段管理',
  14. 'menu' => false,
  15. # 后台菜单排序
  16. 'order' => 6,
  17. 'desc' => '字段唯一标识符:如果用逗号隔开,则前面的是dever公共函数,如maketime.date,则会调用Dever::maketime()来处理date的数据',
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. 'list' => true,
  30. 'order' => 'desc',
  31. ),
  32. 'name' => array
  33. (
  34. 'type' => 'varchar-100',
  35. 'name' => '字段名称',
  36. 'default' => '',
  37. 'desc' => '字段名称',
  38. 'match' => 'is_string',
  39. 'update' => 'text',
  40. 'search' => 'fulltext',
  41. 'list' => true,
  42. 'edit' => true,
  43. ),
  44. 'key' => array
  45. (
  46. 'type' => 'varchar-100',
  47. 'name' => '字段唯一标识符',
  48. 'default' => '',
  49. 'desc' => '字段唯一标识符',
  50. 'match' => 'is_string',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. 'edit' => true,
  55. ),
  56. 'project_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '项目id',
  60. 'default' => Dever::input('search_option_project_id', -1),
  61. 'desc' => '请选择项目id',
  62. 'match' => 'is_numeric',
  63. 'search' => 'order',
  64. 'update' => 'hidden',
  65. ),
  66. 'collect_rule' => array
  67. (
  68. 'type' => 'varchar-500',
  69. 'name' => '采集规则-支持dom解析、正则',
  70. 'default' => '',
  71. 'desc' => '采集规则',
  72. 'match' => 'is_string',
  73. 'update' => 'textarea',
  74. 'list' => true,
  75. 'edit' => 'textarea',
  76. ),
  77. 'collect_include' => array
  78. (
  79. 'type' => 'varchar-500',
  80. 'name' => '包含字符-如果填写该项,则进一步过滤,只保留包含有该字符的',
  81. 'default' => '',
  82. 'desc' => '采集规则',
  83. 'match' => 'option',
  84. 'update' => 'textarea',
  85. ),
  86. 'collect_exclude' => array
  87. (
  88. 'type' => 'varchar-500',
  89. 'name' => '不包含字符-如果填写该项,则进一步过滤,只保留不包含有该字符的',
  90. 'default' => '',
  91. 'desc' => '采集规则',
  92. 'match' => 'option',
  93. 'update' => 'textarea',
  94. ),
  95. 'collect_filter' => array
  96. (
  97. 'type' => 'varchar-500',
  98. 'name' => '过滤规则-如果填写该项,则过滤掉符合该规则的字符,仅支持字符串和正则',
  99. 'default' => '',
  100. 'desc' => '采集规则',
  101. 'match' => 'option',
  102. 'update' => 'textarea',
  103. ),
  104. 'state' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '数据状态',
  108. 'default' => '1',
  109. 'desc' => '请选择状态',
  110. 'match' => 'is_numeric',
  111. ),
  112. 'cdate' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '录入时间',
  116. 'match' => array('is_numeric', time()),
  117. 'desc' => '',
  118. # 只有insert时才生效
  119. 'insert' => true,
  120. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. 'request' => array
  124. (
  125. 'getList' => array
  126. (
  127. 'where' => array
  128. (
  129. 'project_id' => 'yes',
  130. 'state' => 1,
  131. ),
  132. 'type' => 'all',
  133. 'order' => array
  134. (
  135. 'id' => 'desc',
  136. ),
  137. 'col' => '*|key',
  138. ),
  139. )
  140. );