menu.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. $status = array(
  3. 1 => '开启',
  4. 2 => '关闭'
  5. );
  6. return array
  7. (
  8. # 表名
  9. 'name' => 'menu',
  10. # 显示给用户看的名称
  11. 'lang' => '菜单管理',
  12. # 后台菜单排序
  13. 'order' => 1,
  14. # 数据结构
  15. 'struct' => array
  16. (
  17. 'id' => array
  18. (
  19. 'type' => 'int-11',
  20. 'name' => 'ID',
  21. 'default' => '',
  22. 'desc' => '',
  23. 'match' => 'is_numeric',
  24. 'search' => 'order',
  25. 'list' => true,
  26. 'order' => 'desc',
  27. ),
  28. 'name' => array
  29. (
  30. 'type' => 'varchar-32',
  31. 'name' => '菜单名称',
  32. 'default' => '',
  33. 'desc' => '请输入名称',
  34. 'match' => 'is_string',
  35. 'update' => 'text',
  36. 'search' => 'fulltext',
  37. 'list' => true,
  38. ),
  39. 'ename' => array
  40. (
  41. 'type' => 'varchar-32',
  42. 'name' => '菜单英文名称',
  43. 'default' => '',
  44. 'desc' => '菜单英文名称',
  45. 'match' => 'option',
  46. 'update' => 'text',
  47. //'search' => 'fulltext',
  48. //'list' => true,
  49. ),
  50. 'key' => array
  51. (
  52. 'type' => 'varchar-180',
  53. 'name' => '标识',
  54. 'default' => '',
  55. 'desc' => '标识',
  56. 'match' => 'is_string',
  57. //'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. ),
  61. 'reorder' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '排序(数值越大越靠前)',
  65. 'default' => '1',
  66. 'desc' => '请输入排序',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'search' => 'order',
  70. 'list' => true,
  71. 'order' => 'desc',
  72. 'edit' => true,
  73. ),
  74. 'status' => array
  75. (
  76. 'type' => 'tinyint-1',
  77. 'name' => '是否显示',
  78. 'default' => '1',
  79. 'desc' => '是否显示',
  80. 'match' => 'is_numeric',
  81. 'option' => $status,
  82. 'list' => true,
  83. 'edit' => true,
  84. ),
  85. 'state' => array
  86. (
  87. 'type' => 'tinyint-1',
  88. 'name' => '状态',
  89. 'default' => '1',
  90. 'desc' => '请选择状态',
  91. 'match' => 'is_numeric',
  92. ),
  93. 'cdate' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '录入时间',
  97. 'match' => array('is_numeric', time()),
  98. 'desc' => '',
  99. # 只有insert时才生效
  100. 'insert' => true,
  101. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  102. ),
  103. ),
  104. # 默认值
  105. 'default' => array
  106. (
  107. 'col' => 'name,`key`,reorder,cdate',
  108. 'value' => array
  109. (
  110. '"精选课程","course",10,' . time(),
  111. '"讲师团队","teacher",9,' . time(),
  112. '"最新动态","news",8,' . time(),
  113. '"关于我们","about",7,' . time(),
  114. ),
  115. ),
  116. 'manage' => array
  117. (
  118. 'insert' => false,
  119. 'edit' => false,
  120. # 快捷更新
  121. 'list_button' => array
  122. (
  123. 'edit' => array('编辑'),
  124. ),
  125. ),
  126. 'request' => array
  127. (
  128. 'state' => array
  129. (
  130. # 匹配的正则或函数 选填项
  131. 'option' => array
  132. (
  133. 'state' => 1,
  134. ),
  135. 'type' => 'all',
  136. 'order' => array('reorder' => 'desc','id' => 'desc'),
  137. 'col' => '*',
  138. ),
  139. 'getAll' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'state' => 1,
  145. # 小程序去掉视频栏目
  146. 'id_no' => array('yes-id', '!='),
  147. ),
  148. 'type' => 'all',
  149. 'order' => array('reorder' => 'desc','id' => 'desc'),
  150. 'col' => '*',
  151. ),
  152. ),
  153. );