cate.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?php
  2. # 获取小刊分类权限
  3. $auth = Dever::tops();
  4. $type = array
  5. (
  6. # 默认类型
  7. 3 => '图文内容',
  8. 1 => '全屏图',
  9. 2 => '长图',
  10. # 2018-12-11 增加3个类型
  11. 4 => '全屏视频',
  12. 5 => '留言视频',
  13. 6 => '留言音频',
  14. # 关联类型 > 10
  15. 11 => '关联图文',
  16. 12 => '关联视频',
  17. 13 => '关联直播',
  18. );
  19. $list = array
  20. (
  21. # 匹配的正则或函数 选填项
  22. 'option' => array
  23. (
  24. 'name' => array('yes', 'like'),
  25. 'title' => array('yes', 'like'),
  26. 'id' => array($auth, 'in'),
  27. 'journal_id' => 'yes',
  28. ),
  29. 'type' => 'all',
  30. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  31. 'page' => array(20, 'list'),
  32. 'col' => '*|id',
  33. );
  34. $id = Dever::input('where_id');
  35. return array
  36. (
  37. # 表名
  38. 'name' => 'cate',
  39. # 显示给用户看的名称
  40. 'lang' => '小刊分类设置',
  41. # 后台菜单排序
  42. 'order' => 9,
  43. 'end' => array
  44. (
  45. 'update' => array
  46. (
  47. 'passport/lib/manage.updateSystem',
  48. 'manage/top.sync',
  49. ),
  50. 'insert' => array
  51. (
  52. 'passport/lib/manage.updateSystem',
  53. 'manage/top.sync',
  54. )
  55. ),
  56. # 数据结构
  57. 'struct' => array
  58. (
  59. 'id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => 'ID',
  63. 'default' => '',
  64. 'desc' => '',
  65. 'match' => 'is_numeric',
  66. 'search' => 'order',
  67. 'list' => true,
  68. 'order' => 'desc',
  69. ),
  70. 'name' => array
  71. (
  72. 'type' => 'varchar-32',
  73. 'name' => '分类名称',
  74. 'default' => '',
  75. 'desc' => '请输入名称',
  76. 'match' => 'is_string',
  77. 'update' => 'text',
  78. 'search' => 'fulltext',
  79. 'list' => true,
  80. ),
  81. 'type' => array
  82. (
  83. 'type' => 'varchar-100',
  84. 'name' => '内容类型-定义小刊下的内页内容类型',
  85. 'default' => '1,2,3,4,5,6,11,12,13',
  86. 'desc' => '内容类型',
  87. 'match' => 'is_numeric',
  88. 'update' => 'checkbox',
  89. 'option' => $type,
  90. ),
  91. 'journal_id' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '主推小刊',
  95. 'default' => '',
  96. 'desc' => '主推小刊',
  97. 'match' => 'is_numeric',
  98. 'update' => $id ? 'select' : 'hidden',
  99. 'update_search' => 'journal/lib/manage.search_journal?cate=' . $id,
  100. ),
  101. 'title' => array
  102. (
  103. 'type' => 'varchar-32',
  104. 'name' => '页面title-公众号支付中的页面标题',
  105. 'default' => '',
  106. 'desc' => '页面title',
  107. 'match' => 'is_string',
  108. 'update' => 'text',
  109. 'search' => 'fulltext',
  110. // 'list' => true,
  111. ),
  112. 'desc' => array
  113. (
  114. 'type' => 'text-255',
  115. 'name' => '简介',
  116. 'default' => '',
  117. 'desc' => '简介',
  118. 'match' => 'option',
  119. 'update' => 'textarea',
  120. ),
  121. 'cover' => array
  122. (
  123. 'type' => 'varchar-150',
  124. 'name' => '封面图-公众号支付中的封面图,图片尺寸460*759px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  125. 'default' => '',
  126. 'desc' => '封面图',
  127. 'match' => 'option',
  128. 'update' => 'image',
  129. 'key' => '1',
  130. 'place' => '150',
  131. ),
  132. 'logo' => array
  133. (
  134. 'type' => 'varchar-150',
  135. 'name' => 'logo图-当前分类的logo图,图片尺寸100*100px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  136. 'default' => '',
  137. 'desc' => 'logo图',
  138. 'match' => 'option',
  139. 'update' => 'image',
  140. 'key' => '1',
  141. 'place' => '150',
  142. ),
  143. 'reorder' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '排序(数值越大越靠前)',
  147. 'default' => '1',
  148. 'desc' => '请输入排序',
  149. 'match' => 'option',
  150. 'update' => 'text',
  151. 'search' => 'order',
  152. 'list' => true,
  153. 'order' => 'desc',
  154. 'edit' => true,
  155. ),
  156. 'code_desc' => array
  157. (
  158. 'type' => 'text-255',
  159. 'name' => '兑换说明',
  160. 'default' => '',
  161. 'desc' => '兑换说明',
  162. 'match' => 'option',
  163. 'update' => 'editor',
  164. ),
  165. 'state' => array
  166. (
  167. 'type' => 'tinyint-1',
  168. 'name' => '状态',
  169. 'default' => '1',
  170. 'desc' => '请选择状态',
  171. 'match' => 'is_numeric',
  172. ),
  173. 'cdate' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '录入时间',
  177. 'match' => array('is_numeric', time()),
  178. 'desc' => '',
  179. # 只有insert时才生效
  180. 'insert' => true,
  181. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  182. ),
  183. ),
  184. # 默认值
  185. 'default' => array
  186. (
  187. 'col' => 'name,state,cdate',
  188. 'value' => array
  189. (
  190. '"默认分类",1,' . time(),
  191. ),
  192. ),
  193. 'manage' => array
  194. (
  195. //'insert' => false,
  196. //'edit' => false,
  197. ),
  198. 'top' => array
  199. (
  200. # 数据来源
  201. 'data' => 'state',
  202. # 菜单名
  203. 'name' => '项目选择',
  204. # 默认值
  205. 'value' => 1,
  206. # 对应的字段值,设置这个之后,所有设置等于这个值的字段,都要遵循这个权限的控制
  207. 'key' => Dever::config('base')->top,
  208. # 本表中代表名称的字段
  209. 'col' => 'name',
  210. ),
  211. 'request' => array
  212. (
  213. 'list' => $list,
  214. 'getAll' => array
  215. (
  216. # 匹配的正则或函数 选填项
  217. 'option' => array
  218. (
  219. 'state' => 1,
  220. ),
  221. 'type' => 'all',
  222. 'order' => array('reorder' => 'desc','id' => 'desc'),
  223. 'col' => '*',
  224. ),
  225. 'getIds' => array
  226. (
  227. # 匹配的正则或函数 选填项
  228. 'option' => array
  229. (
  230. 'ids' => array('yes-id', 'in'),
  231. 'state' => 1,
  232. ),
  233. 'type' => 'all',
  234. 'order' => array('reorder' => 'desc','id' => 'desc'),
  235. 'col' => '*,id as value|id',
  236. ),
  237. ),
  238. );