cate.php 7.8 KB

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