cate.php 7.5 KB

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