config_child.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. $config = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('score/config')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'config_child',
  16. # 显示给用户看的名称
  17. 'lang' => '子积分设置',
  18. 'order' => 1,
  19. 'menu' => false,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. ),
  31. 'name' => array
  32. (
  33. 'type' => 'varchar-32',
  34. 'name' => '积分名称',
  35. 'default' => '',
  36. 'desc' => '请输入积分名称',
  37. 'match' => 'is_string',
  38. 'update' => 'text',
  39. 'search' => 'fulltext',
  40. 'list' => true,
  41. ),
  42. 'type' => array
  43. (
  44. 'type' => 'varchar-32',
  45. 'name' => '所属数据源',
  46. 'default' => '',
  47. 'desc' => '所属数据源',
  48. 'match' => 'is_string',
  49. //'update' => 'select',
  50. 'list' => true,
  51. ),
  52. 'type_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '数据源id',
  56. 'default' => '',
  57. 'desc' => '数据源id',
  58. 'match' => 'is_numeric',
  59. //'update' => 'text',
  60. 'list' => true,
  61. ),
  62. 'config_id' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '上级积分名称',
  66. 'default' => '1',
  67. 'desc' => '上级积分名称',
  68. 'match' => 'is_numeric',
  69. 'update' => 'select',
  70. 'option' => $config,
  71. 'search' => 'select',
  72. 'list' => true,
  73. ),
  74. 'config_id' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '上级积分名称',
  78. 'default' => '1',
  79. 'desc' => '上级积分名称',
  80. 'match' => 'is_numeric',
  81. 'update' => 'select',
  82. 'option' => $config,
  83. 'search' => 'select',
  84. 'list' => true,
  85. ),
  86. 'reorder' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '排序(数值越大越靠前)',
  90. 'default' => '1',
  91. 'desc' => '请输入排序',
  92. 'match' => 'option',
  93. 'update' => 'text',
  94. 'search' => 'order',
  95. 'list' => true,
  96. 'order' => 'desc',
  97. 'edit' => true,
  98. ),
  99. 'state' => array
  100. (
  101. 'type' => 'tinyint-1',
  102. 'name' => '状态',
  103. 'default' => '1',
  104. 'desc' => '请选择状态',
  105. 'match' => 'is_numeric',
  106. ),
  107. 'cdate' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '录入时间',
  111. 'match' => array('is_numeric', time()),
  112. 'desc' => '',
  113. # 只有insert时才生效
  114. 'insert' => true,
  115. ),
  116. ),
  117. # 索引
  118. 'index' => array
  119. (
  120. 1 => array
  121. (
  122. 'search' => 'config_id,type,type_id',
  123. ),
  124. # 版本号 更改版本号会更新当前表的索引
  125. 'version' => 1,
  126. ),
  127. 'manage' => array
  128. (
  129. 'insert' => false,
  130. 'edit' => false,
  131. 'delete' => false,
  132. ),
  133. 'request' => array
  134. (
  135. ),
  136. );