filter_task.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '生效',
  6. 2 => '失效',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'filter_task',
  12. # 显示给用户看的名称
  13. 'lang' => '过滤系统任务',
  14. 'menu' => false,
  15. 'check' => 'content.s',
  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. 'order' => 'desc',
  27. ),
  28. 'name' => array
  29. (
  30. 'type' => 'varchar-100',
  31. 'name' => '表名+id',
  32. 'default' => '',
  33. 'desc' => '请输入表名+id',
  34. 'match' => 'is_string',
  35. 'update' => 'text',
  36. 'search' => 'fulltext',
  37. 'list' => true,
  38. ),
  39. 'content' => array
  40. (
  41. 'type' => 'text-255',
  42. 'name' => '过滤的内容',
  43. 'default' => '',
  44. 'desc' => '请输入过滤的内容',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'search' => 'fulltext',
  48. //'list' => true,
  49. ),
  50. 'state' => array
  51. (
  52. 'type' => 'tinyint-1',
  53. 'name' => '状态',
  54. 'default' => '1',
  55. 'desc' => '请选择状态',
  56. 'match' => array('is_numeric', 1),
  57. 'option' => $option,
  58. 'update' => 'radio',
  59. 'list' => true,
  60. ),
  61. 'cdate' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '录入时间',
  65. 'match' => array('is_numeric', time()),
  66. 'desc' => '',
  67. # 只有insert时才生效
  68. 'insert' => true,
  69. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  70. ),
  71. ),
  72. # request 请求接口定义
  73. 'request' => array
  74. (
  75. 'data' => array
  76. (
  77. 'limit' => array(10, 0),
  78. 'type' => 'all',
  79. 'order' => array('id', 'asc'),
  80. 'col' => 'id,name,content|id',
  81. ),
  82. 'dels' => array
  83. (
  84. 'where' => array
  85. (
  86. 'id' => array('yes', 'in'),
  87. ),
  88. 'type' => 'delete',
  89. ),
  90. )
  91. );