col.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. <br />
  19. <a href="'.Dever::url('spider/lib/api.run?id=' . Dever::input('search_option_project_id', -1) . '&test=1').'" target="_blank">点此进行测试</a>:请按住ctrl打开新页面并查看源代码',
  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. 'project_id' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '项目id',
  62. 'default' => Dever::input('search_option_project_id', -1),
  63. 'desc' => '请选择项目id',
  64. 'match' => 'is_numeric',
  65. 'search' => 'order',
  66. 'update' => 'hidden',
  67. ),
  68. 'collect_rule' => array
  69. (
  70. 'type' => 'varchar-500',
  71. 'name' => '采集规则-支持dom解析、正则',
  72. 'default' => '',
  73. 'desc' => '采集规则',
  74. 'match' => 'is_string',
  75. 'update' => 'textarea',
  76. 'list' => true,
  77. 'edit' => 'textarea',
  78. ),
  79. 'collect_include' => array
  80. (
  81. 'type' => 'varchar-500',
  82. 'name' => '包含字符-如果填写该项,则进一步过滤,只保留包含有该字符的',
  83. 'default' => '',
  84. 'desc' => '采集规则',
  85. 'match' => 'option',
  86. 'update' => 'textarea',
  87. ),
  88. 'collect_exclude' => array
  89. (
  90. 'type' => 'varchar-500',
  91. 'name' => '不包含字符-如果填写该项,则进一步过滤,只保留不包含有该字符的',
  92. 'default' => '',
  93. 'desc' => '采集规则',
  94. 'match' => 'option',
  95. 'update' => 'textarea',
  96. ),
  97. 'collect_filter' => array
  98. (
  99. 'type' => 'varchar-500',
  100. 'name' => '过滤规则-如果填写该项,则过滤掉符合该规则的字符,仅支持字符串和正则',
  101. 'default' => '',
  102. 'desc' => '采集规则',
  103. 'match' => 'option',
  104. 'update' => 'textarea',
  105. ),
  106. 'state' => array
  107. (
  108. 'type' => 'tinyint-1',
  109. 'name' => '数据状态',
  110. 'default' => '1',
  111. 'desc' => '请选择状态',
  112. 'match' => 'is_numeric',
  113. ),
  114. 'cdate' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '录入时间',
  118. 'match' => array('is_numeric', time()),
  119. 'desc' => '',
  120. # 只有insert时才生效
  121. 'insert' => true,
  122. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  123. ),
  124. ),
  125. 'request' => array
  126. (
  127. 'getList' => array
  128. (
  129. 'where' => array
  130. (
  131. 'project_id' => 'yes',
  132. 'state' => 1,
  133. ),
  134. 'type' => 'all',
  135. 'order' => array
  136. (
  137. 'id' => 'desc',
  138. ),
  139. 'col' => '*|key',
  140. ),
  141. )
  142. );