data.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '正常',
  6. 2 => '删除',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'data',
  12. # 显示给用户看的名称
  13. 'lang' => '数据管理',
  14. # 后台菜单排序
  15. 'order' => 6,
  16. 'menu' => false,
  17. # 数据结构
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. 'search' => 'order',
  28. //'list' => true,
  29. 'order' => 'desc',
  30. ),
  31. 'project_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '项目',
  35. 'default' => '1',
  36. 'desc' => '请选择项目id',
  37. 'match' => 'is_numeric',
  38. 'list' => '{project_id} > 0 ? Dever::load("spider/project-one#name", {project_id}) : "无"',
  39. # 开启显示控制,可以控制下边的表单
  40. //'show' => 'cate_id',
  41. ),
  42. 'value' => array
  43. (
  44. 'type' => 'text-1000',
  45. 'name' => '数据',
  46. 'default' => '',
  47. 'desc' => '数据',
  48. 'match' => 'is_string',
  49. //'update' => 'editor',
  50. 'search' => 'fulltext',
  51. //'list' => 'Dever::load("spider/data.value", {id})',
  52. //'modal' => '查看详情',
  53. ),
  54. 'log_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '日志id',
  58. 'default' => '1',
  59. 'desc' => '请输入日志id',
  60. 'match' => 'is_numeric',
  61. //'update' => 'text',
  62. 'search' => 'fulltext',
  63. //'list' => true,
  64. ),
  65. 'state' => array
  66. (
  67. 'type' => 'tinyint-1',
  68. 'name' => '数据状态',
  69. 'default' => '1',
  70. 'desc' => '请选择状态',
  71. 'match' => 'is_numeric',
  72. ),
  73. 'cdate' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '录入时间',
  77. 'match' => array('is_numeric', time()),
  78. 'desc' => '',
  79. # 只有insert时才生效
  80. //'insert' => true,
  81. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  82. ),
  83. ),
  84. 'manage' => array
  85. (
  86. # 开启批量管理
  87. //'mul' => true,
  88. 'insert' => false,
  89. 'delete' => false,
  90. ),
  91. # request 请求接口定义
  92. 'request' => array
  93. (
  94. # 更新浏览量
  95. 'addView' => array
  96. (
  97. 'type' => 'update',
  98. 'where' => array
  99. (
  100. 'id' => 'yes',
  101. ),
  102. 'set' => array
  103. (
  104. 'num_view' => array('1', '+='),
  105. ),
  106. ),
  107. 'getAll' => array
  108. (
  109. # 匹配的正则或函数 选填项
  110. 'option' => array
  111. (
  112. 'config_id' => 'yes',
  113. 'state' => 1,
  114. ),
  115. 'type' => 'all',
  116. 'order' => array('id', 'asc'),
  117. ),
  118. ),
  119. );