system.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. $token = array();
  3. if (Dever::project('token')) {
  4. $token = function()
  5. {
  6. $array = array();
  7. $info = Dever::db('token/project')->state();
  8. if ($info) {
  9. $array += $info;
  10. }
  11. return $array;
  12. };
  13. }
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'system',
  18. # 显示给用户看的名称
  19. 'lang' => '项目管理',
  20. # 后台菜单排序
  21. 'order' => 1,
  22. /*
  23. 'end' => array
  24. (
  25. 'insert' => array
  26. (
  27. 'manage/top.sync',
  28. ),
  29. 'update' => array
  30. (
  31. 'manage/top.sync',
  32. ),
  33. ),
  34. */
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. 'search' => 'order',
  46. 'list' => true,
  47. 'order' => 'desc',
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-32',
  52. 'name' => '项目名称',
  53. 'default' => '',
  54. 'desc' => '项目名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'appid' => array
  61. (
  62. 'type' => 'varchar-150',
  63. 'name' => '微信小程序appid-废弃',
  64. 'default' => '',
  65. 'desc' => '请输入微信小程序appid',
  66. 'match' => 'option',
  67. //'search' => 'order,fulltext',
  68. //'update' => 'text',
  69. //'list' => 'table',
  70. //'modal' => '详细信息',
  71. ),
  72. 'secret' => array
  73. (
  74. 'type' => 'varchar-150',
  75. 'name' => '微信小程序secret-废弃',
  76. 'default' => '',
  77. 'desc' => '请输入微信小程序secret',
  78. 'match' => 'option',
  79. //'search' => 'order,fulltext',
  80. //'update' => 'text',
  81. //'list' => 'table',
  82. //'modal' => '详细信息',
  83. ),
  84. 'token_project_id' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '关联token',
  88. 'default' => '-1',
  89. 'desc' => '关联token',
  90. 'match' => 'is_numeric',
  91. 'option' => $token,
  92. 'update' => $token ? 'select' : false,
  93. 'list' => $token ? true : false,
  94. ),
  95. 'reorder' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '排序(数值越大越靠前)',
  99. 'default' => '1',
  100. 'desc' => '请输入排序',
  101. 'match' => 'option',
  102. 'update' => 'text',
  103. 'search' => 'order',
  104. 'list' => true,
  105. 'order' => 'desc',
  106. 'edit' => true,
  107. ),
  108. 'state' => array
  109. (
  110. 'type' => 'tinyint-1',
  111. 'name' => '状态',
  112. 'default' => '1',
  113. 'desc' => '请选择状态',
  114. 'match' => 'is_numeric',
  115. ),
  116. 'cdate' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '录入时间',
  120. 'match' => array('is_numeric', time()),
  121. 'desc' => '',
  122. # 只有insert时才生效
  123. 'insert' => true,
  124. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  125. ),
  126. ),
  127. # 默认值
  128. 'default' => array
  129. (
  130. 'col' => 'name,state,cdate',
  131. 'value' => array
  132. (
  133. '"默认项目",1,' . time(),
  134. ),
  135. ),
  136. 'manage' => array
  137. (
  138. 'insert' => false,
  139. 'edit' => false,
  140. # 自定义快捷新增和编辑
  141. 'button' => array
  142. (
  143. '新增' => array('fast'),
  144. ),
  145. # 快捷更新
  146. 'list_button' => array
  147. (
  148. 'edit' => array('编辑'),
  149. ),
  150. ),
  151. /*
  152. 'top' => array
  153. (
  154. # 数据来源
  155. 'data' => 'state',
  156. # 菜单名
  157. 'name' => '项目选择',
  158. # 默认值
  159. 'value' => 1,
  160. # 对应的字段值,设置这个之后,所有设置等于这个值的字段,都要遵循这个权限的控制
  161. 'key' => 'passport/system_id',
  162. # 本表中代表名称的字段
  163. 'col' => 'name',
  164. ),*/
  165. 'request' => array
  166. (
  167. 'getAll' => array
  168. (
  169. # 匹配的正则或函数 选填项
  170. 'option' => array
  171. (
  172. 'state' => 1,
  173. ),
  174. 'type' => 'all',
  175. 'order' => array('reorder' => 'desc','id' => 'desc'),
  176. 'col' => '*',
  177. ),
  178. ),
  179. );