site.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <?php
  2. /**
  3. * user
  4. */
  5. # 定义几个常用的选项
  6. $option = array
  7. (
  8. 1 => '正常',
  9. 2 => '不可用',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'site',
  15. # 显示给用户看的名称
  16. 'lang' => '站点配置',
  17. 'order' => 100,
  18. 'desc' => '服务器地址:'.Dever::url('weixin/service.push?site=?').' 问号请替换成id',
  19. 'end' => array
  20. (
  21. 'insert' => 'manage/top.sync',
  22. 'update' => 'manage/top.sync',
  23. ),
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'list' => true,
  36. ),
  37. 'name' => array
  38. (
  39. 'type' => 'varchar-50',
  40. 'name' => '站点名称',
  41. 'default' => '',
  42. 'desc' => '请输入站点名称',
  43. 'match' => 'is_string',
  44. 'search' => 'fulltext',
  45. 'update' => 'text',
  46. 'list' => true,
  47. ),
  48. 'site' => array
  49. (
  50. 'type' => 'varchar-100',
  51. 'name' => '站点网址',
  52. 'default' => '',
  53. 'desc' => '请输入站点网址',
  54. 'match' => 'is_string',
  55. 'search' => 'order,fulltext',
  56. 'update' => 'text',
  57. 'list' => true,
  58. ),
  59. 'weixin' => array
  60. (
  61. 'type' => 'varchar-100',
  62. 'name' => '微信号',
  63. 'default' => '',
  64. 'desc' => '请输入微信号',
  65. 'match' => 'is_string',
  66. 'search' => 'order,fulltext',
  67. 'update' => 'text',
  68. 'list' => true,
  69. ),
  70. 'appid' => array
  71. (
  72. 'type' => 'varchar-150',
  73. 'name' => '微信appid',
  74. 'default' => '',
  75. 'desc' => '请输入微信appid',
  76. 'match' => 'is_string',
  77. 'search' => 'order,fulltext',
  78. 'update' => 'text',
  79. 'list' => 'table',
  80. 'modal' => '详细信息',
  81. ),
  82. 'secret' => array
  83. (
  84. 'type' => 'varchar-150',
  85. 'name' => '微信secret',
  86. 'default' => '',
  87. 'desc' => '请输入微信secret',
  88. 'match' => 'is_string',
  89. 'search' => 'order,fulltext',
  90. 'update' => 'text',
  91. //'list' => 'table',
  92. //'modal' => '详细信息',
  93. ),
  94. 'token' => array
  95. (
  96. 'type' => 'varchar-150',
  97. 'name' => '通信token(注意不是access_token)',
  98. 'default' => '',
  99. 'desc' => '请输入通信token',
  100. 'match' => 'is_string',
  101. 'update' => 'text',
  102. ),
  103. 'key' => array
  104. (
  105. 'type' => 'varchar-150',
  106. 'name' => '消息加解密密钥',
  107. 'default' => '',
  108. 'desc' => '请输入消息加解密密钥',
  109. 'match' => 'option',
  110. 'update' => 'text',
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => array('is_numeric', 1),
  119. 'option' => $option,
  120. 'update' => 'radio',
  121. //'list' => true,
  122. ),
  123. 'cdate' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '录入时间',
  127. 'match' => array('is_numeric', time()),
  128. 'desc' => '',
  129. # 只有insert时才生效
  130. 'insert' => true,
  131. ),
  132. ),
  133. # 更新表结构
  134. 'alter' => array
  135. (
  136. 1 => array
  137. (
  138. array('add', 'weixin', 'weixin', 'varchar-100 微信号'),
  139. ),
  140. 'version' => 1,
  141. ),
  142. 'manage' => array
  143. (
  144. //'insert' => false,
  145. //'list_button' => array(6 => '加入到cron'),
  146. 'button' => array
  147. (
  148. //'重新同步' => 'manage/api.update',
  149. )
  150. ),
  151. # 后台新增功能,权限精细控制 加入到头部右侧可选菜单中
  152. 'auth' => array
  153. (
  154. # 数据来源
  155. 'data' => 'getAll',
  156. # 菜单名
  157. 'name' => '站点选择',
  158. # 默认值
  159. 'value' => 1,
  160. # 对应的字段值,设置这个之后,所有设置auth等于这个值的字段,都要遵循这个权限的控制
  161. 'key' => 'site',
  162. # 本表中代表名称的字段
  163. 'col' => 'name',
  164. ),
  165. 'request' => array
  166. (
  167. 'getAll' => array
  168. (
  169. 'where' => array
  170. (
  171. 'state' => 1,
  172. ),
  173. 'type' => 'all',
  174. 'order' => array('id', 'desc'),
  175. 'col' => '*|id',
  176. ),
  177. ),
  178. );