data.php 2.3 KB

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