data.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '正常',
  6. 2 => '删除',
  7. );
  8. $pid = Dever::input('search_option_pid');
  9. return array
  10. (
  11. # 表名
  12. 'name' => 'data',
  13. # 显示给用户看的名称
  14. 'lang' => '数据管理',
  15. # 后台菜单排序
  16. 'order' => 6,
  17. 'menu' => false,
  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. 'pid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '项目',
  36. 'default' => '1',
  37. 'desc' => '请选择项目id',
  38. 'match' => 'is_numeric',
  39. //'list' => '{pid} > 0 ? Dever::load("spider/project-one#name", {pid}) : "无"',
  40. # 开启显示控制,可以控制下边的表单
  41. //'show' => 'cate_id',
  42. ),
  43. 'source' => array
  44. (
  45. 'type' => 'varchar-2000',
  46. 'name' => '来源',
  47. 'default' => '',
  48. 'desc' => '来源',
  49. 'match' => 'is_string',
  50. 'update' => 'text',
  51. 'search' => 'fulltext',
  52. 'list' => true,
  53. ),
  54. 'value' => array
  55. (
  56. 'type' => 'text-1000',
  57. 'name' => '数据',
  58. 'default' => '',
  59. 'desc' => '数据',
  60. 'match' => 'is_string',
  61. //'update' => 'editor',
  62. 'search' => 'fulltext',
  63. 'list' => 'Dever::load("spider/data.value", {id})',
  64. //'modal' => '查看详情',
  65. ),
  66. 'log_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '日志id',
  70. 'default' => '1',
  71. 'desc' => '请输入日志id',
  72. 'match' => 'is_numeric',
  73. //'update' => 'text',
  74. 'search' => 'fulltext',
  75. //'list' => true,
  76. ),
  77. 'state' => array
  78. (
  79. 'type' => 'tinyint-1',
  80. 'name' => '数据状态',
  81. 'default' => '1',
  82. 'desc' => '请选择状态',
  83. 'match' => 'is_numeric',
  84. ),
  85. 'cdate' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '录入时间',
  89. 'match' => array('is_numeric', time()),
  90. 'desc' => '',
  91. # 只有insert时才生效
  92. //'insert' => true,
  93. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  94. ),
  95. ),
  96. 'manage' => array
  97. (
  98. # 开启批量管理
  99. //'mul' => true,
  100. 'insert' => false,
  101. 'edit' => false,
  102. //'delete' => false,
  103. # 自定义快捷新增和编辑
  104. 'button' => array
  105. (
  106. //'新增兑换码' => array('fast', 1, 'config&where_id=1'),
  107. //'导出EXCEL' => array('location', 'spider/data.excel?id=' . $pid),
  108. '导出SQL' => array('location', 'spider/data.sql?id=' . $pid . '&time=' . time()),
  109. '清空数据' => array('oper', 'spider/data.drop?id=' . $pid),
  110. ),
  111. ),
  112. # request 请求接口定义
  113. 'request' => array
  114. (
  115. # 更新浏览量
  116. 'addView' => array
  117. (
  118. 'type' => 'update',
  119. 'where' => array
  120. (
  121. 'id' => 'yes',
  122. ),
  123. 'set' => array
  124. (
  125. 'num_view' => array('1', '+='),
  126. ),
  127. ),
  128. 'getAll' => array
  129. (
  130. # 匹配的正则或函数 选填项
  131. 'option' => array
  132. (
  133. 'config_id' => 'yes',
  134. 'state' => 1,
  135. ),
  136. 'type' => 'all',
  137. 'order' => array('id', 'asc'),
  138. ),
  139. 'getOne' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'pid' => 'yes',
  145. 'state' => 1,
  146. ),
  147. 'type' => 'one',
  148. 'order' => array('id', 'desc'),
  149. ),
  150. ),
  151. );