cate.php 7.9 KB

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