cate.php 7.0 KB

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