data.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $info = Dever::load('attr/cate-state');
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'data',
  16. # 显示给用户看的名称
  17. 'lang' => '标签数据关联表',
  18. # 是否显示在后台菜单
  19. 'order' => 10,
  20. 'menu' => false,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'order' => 'asc',
  32. 'list' => true,
  33. ),
  34. 'tag_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '标签ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. //'search' => 'order',
  42. 'list' => true,
  43. ),
  44. 'type' => array
  45. (
  46. 'type' => 'varchar-60',
  47. 'name' => '类型',
  48. 'default' => '',
  49. 'desc' => '类型',
  50. 'match' => 'is_string',
  51. 'list' => true,
  52. ),
  53. 'type_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '关联ID',
  57. 'default' => '',
  58. 'desc' => '',
  59. 'match' => 'is_numeric',
  60. //'search' => 'order',
  61. 'list' => true,
  62. ),
  63. 'state' => array
  64. (
  65. 'type' => 'tinyint-1',
  66. 'name' => '状态',
  67. 'default' => '1',
  68. 'desc' => '请选择状态',
  69. 'match' => 'is_numeric',
  70. ),
  71. 'cdate' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '录入时间',
  75. 'match' => array('is_numeric', time()),
  76. 'desc' => '',
  77. # 只有insert时才生效
  78. 'insert' => true,
  79. 'search' => 'date',
  80. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  81. ),
  82. ),
  83. 'manage' => array
  84. (
  85. # 列表页的类型
  86. ),
  87. 'request' => array
  88. (
  89. 'deleteByType' => array
  90. (
  91. 'where' => array
  92. (
  93. 'type' => 'yes',
  94. 'type_id' => 'yes',
  95. ),
  96. 'type' => 'delete',
  97. ),
  98. 'getAll' => array
  99. (
  100. # 匹配的正则或函数 选填项
  101. 'option' => array
  102. (
  103. //'info_id' => 'yes',
  104. 'tag_id' => 'yes',
  105. 'state' => 1,
  106. ),
  107. 'type' => 'all',
  108. 'order' => array('cdate' => 'desc'),
  109. 'page' => array(12, 'list'),
  110. 'col' => '*',
  111. )
  112. )
  113. );