info.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <?php
  2. $audit = Dever::config('base')->audit;
  3. $audit = array
  4. (
  5. 1 => '未上线',
  6. 2 => '上线发布',
  7. );
  8. $share = function()
  9. {
  10. $array = array();
  11. $info = Dever::db('poster/template')->state();
  12. if($info)
  13. {
  14. $array += $info;
  15. }
  16. return $array;
  17. };
  18. $page = 15;
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'info',
  23. # 显示给用户看的名称
  24. 'lang' => '小刊管理',
  25. 'order' => 100,
  26. # 同步更新另外一个或多个表的数据 小刊不需要同步到审核页面
  27. /*
  28. 'syncone' => array
  29. (
  30. 'audit/data' => array
  31. (
  32. # 更新另外一个表的字段 => 本表的字段
  33. 'where' => array('data_id' => 'id', 'type' => 4),
  34. # 要更新的数据
  35. 'update' => array('data_id' => 'id', 'type' => 4, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit'),
  36. )
  37. ),
  38. */
  39. # 数据结构
  40. 'struct' => array
  41. (
  42. 'id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => 'ID',
  46. 'default' => '',
  47. 'desc' => '',
  48. 'match' => 'is_numeric',
  49. 'list' => true,
  50. ),
  51. 'name' => array
  52. (
  53. 'type' => 'varchar-180',
  54. 'name' => '杂志标题',
  55. 'default' => '',
  56. 'desc' => '标题',
  57. 'match' => 'is_string',
  58. 'update' => 'text',
  59. 'search' => 'fulltext',
  60. 'list' => true,
  61. ),
  62. 'subname' => array
  63. (
  64. 'type' => 'varchar-80',
  65. 'name' => '子标题-一般为杂志的期数,如第1期',
  66. 'default' => '',
  67. 'desc' => '子标题',
  68. 'match' => 'is_string',
  69. 'update' => 'text',
  70. //'list' => true,
  71. ),
  72. 'pic_cover' => array
  73. (
  74. 'type' => 'varchar-150',
  75. 'name' => '列表页封面图-4:3比例的图片',
  76. 'default' => '',
  77. 'desc' => '列表封面图',
  78. 'match' => 'option',
  79. //'update' => 'image',
  80. 'key' => '1',
  81. 'place' => '150',
  82. ),
  83. 'pic_view_cover' => array
  84. (
  85. 'type' => 'varchar-150',
  86. 'name' => '封面图-1:1比例的图片',
  87. 'default' => '',
  88. 'desc' => '封面图',
  89. 'match' => 'option',
  90. 'update' => 'image',
  91. 'key' => '1',
  92. 'place' => '150',
  93. ),
  94. 'pic_view_bg' => array
  95. (
  96. 'type' => 'text-255',
  97. 'name' => '全屏背景图-进入小刊阅读页之前的全屏背景图,可以多张切换,尽量保持在5张之内',
  98. 'default' => '',
  99. 'desc' => '全屏背景图',
  100. 'match' => 'option',
  101. 'update' => 'images',
  102. 'key' => '1',
  103. 'place' => '150',
  104. ),
  105. 'num_add_ding' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '订阅数基数',
  109. 'default' => '0',
  110. 'desc' => '手动增加阅读数',
  111. 'match' => 'option',
  112. 'update' => 'text',
  113. ),
  114. 'num_ding' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '订阅数',
  118. 'default' => '0',
  119. 'desc' => '请填写订阅数',
  120. 'match' => 'option',
  121. 'search' => 'order',
  122. //'list' => '{num_view}+{num_add_view}',
  123. ),
  124. 'num_add_view' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '阅读数基数',
  128. 'default' => '0',
  129. 'desc' => '手动增加阅读数',
  130. 'match' => 'option',
  131. 'update' => 'text',
  132. ),
  133. 'num_view' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '阅读数',
  137. 'default' => '0',
  138. 'desc' => '请填写阅读数',
  139. 'match' => 'option',
  140. 'search' => 'order',
  141. //'list' => '{num_view}+{num_add_view}',
  142. ),
  143. 'num_up' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '喜欢数',
  147. 'default' => '0',
  148. 'desc' => '请填写喜欢数',
  149. 'match' => 'option',
  150. //'search' => 'order',
  151. 'list' => '"订阅数:{num_add_ding}+{num_ding}<br />喜欢数:{num_up}<br />阅读数:{num_view}+{num_add_view}<br />评论数:{num_comment}<br />"',
  152. 'list_name' => '统计数字',
  153. ),
  154. 'num_comment' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '评论数',
  158. 'default' => '0',
  159. 'desc' => '请填写评论数',
  160. 'search' => 'order',
  161. 'match' => 'option',
  162. //'list' => true,
  163. ),
  164. 'state' => array
  165. (
  166. 'type' => 'tinyint-1',
  167. 'name' => '状态',
  168. 'default' => '1',
  169. 'desc' => '请选择状态',
  170. 'match' => 'is_numeric',
  171. ),
  172. 'audit' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '上线状态',
  176. 'default' => '1',
  177. 'desc' => '审核',
  178. 'match' => 'is_numeric',
  179. //'update' => 'select',
  180. 'option' => $audit,
  181. 'search' => 'select',
  182. 'list' => true,
  183. 'edit' => true,
  184. ),
  185. 'admin_founder' => array
  186. (
  187. 'type' => 'int-11',
  188. 'name' => '创建人',
  189. 'default' => '1',
  190. 'desc' => '创建人',
  191. 'match' => 'is_numeric',
  192. ),
  193. 'admin_editor' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '操作人',
  197. 'default' => '1',
  198. 'desc' => '操作人',
  199. 'match' => 'is_numeric',
  200. ),
  201. 'pdate' => array
  202. (
  203. 'type' => 'int-11',
  204. 'name' => '发布时间',
  205. 'match' => array('is_numeric', time()),
  206. 'default' => '',
  207. 'desc' => '',
  208. 'update' => 'date',
  209. 'callback' => 'maketime',
  210. 'insert' => true,
  211. 'list' => 'date("Y-m-d H:i:s", {pdate})',
  212. 'auth' => '"{pdate}" > 0',
  213. ),
  214. 'share' => array
  215. (
  216. 'type' => 'text-255',
  217. 'name' => '分享海报-选择海报库中的海报',
  218. 'default' => '',
  219. 'desc' => '分享海报',
  220. 'match' => 'option',
  221. //'update' => 'checkbox',
  222. 'option' => $share,
  223. ),
  224. 'reorder' => array
  225. (
  226. 'type' => 'int-11',
  227. 'name' => '排序(数值越大越靠前)',
  228. 'default' => '1',
  229. 'desc' => '请输入排序',
  230. 'match' => 'option',
  231. 'update' => 'text',
  232. 'search' => 'order',
  233. 'list' => true,
  234. 'order' => 'desc',
  235. 'edit' => true,
  236. ),
  237. 'udate' => array
  238. (
  239. 'type' => 'int-11',
  240. 'name' => '更新时间',
  241. 'match' => array('is_numeric', time()),
  242. 'desc' => '',
  243. ),
  244. 'cdate' => array
  245. (
  246. 'type' => 'int-11',
  247. 'name' => '录入时间',
  248. 'match' => array('is_numeric', time()),
  249. 'desc' => '',
  250. # 只有insert时才生效
  251. 'insert' => true,
  252. ),
  253. ),
  254. # 索引
  255. 'index' => array
  256. (
  257. 'version' => 1,
  258. 1 => array
  259. (
  260. 'i1' => 'uid,cate_id',
  261. )
  262. ),
  263. # 管理功能
  264. 'manage' => array
  265. (
  266. //'insert' => false,
  267. 'delete' => false,
  268. # 列表
  269. 'list_button' => array
  270. (
  271. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  272. 'br' => array('<br />'),
  273. 'add' => array('购买设置', '"buy&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
  274. 'add1' => array('活动设置', '"active&project=journal&search_option_info_id={id}&oper_parent=info&oper_project=journal&oper_save_jump=info&where_id={id}"', '{audit} == 1'),
  275. 'br1' => array('<br />'),
  276. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1'),
  277. 'br2' => array('<br />'),
  278. 'edit' => array('预览', Dever::url('main/preview.get?type=4')),
  279. ),
  280. ),
  281. # request 请求接口定义
  282. 'request' => array
  283. (
  284. 'search' => array
  285. (
  286. # 匹配的正则或函数 选填项
  287. 'option' => array
  288. (
  289. 'ids' => array('yes-id', 'in'),
  290. //'cate_id' => 'yes',
  291. 'name' => array('yes', 'like'),
  292. 'id' => 'yes',
  293. ),
  294. 'type' => 'all',
  295. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  296. 'limit' => '0,1000',
  297. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled',
  298. ),
  299. 'getAll' => array
  300. (
  301. # 匹配的正则或函数 选填项
  302. 'option' => array
  303. (
  304. 'cate_id' => 'yes',
  305. 'cate_ids' => array('yes-cate_id', 'in'),
  306. 'id' => 'yes',
  307. ),
  308. 'type' => 'all',
  309. 'order' => array('id' => 'desc'),
  310. 'page' => array($page, 'list'),
  311. 'col' => '*',
  312. ),
  313. # 获取默认主题,按照置顶和时间排序的
  314. 'default' => array
  315. (
  316. # 匹配的正则或函数 选填项
  317. 'option' => array
  318. (
  319. 'cate_id' => 'yes',
  320. 'uid' => 'yes',
  321. ),
  322. 'type' => 'all',
  323. 'order' => array('id' => 'desc'),
  324. 'page' => array($page, 'list'),
  325. 'col' => '*',
  326. ),
  327. # 获取最新主题
  328. 'new' => array
  329. (
  330. # 匹配的正则或函数 选填项
  331. 'option' => array
  332. (
  333. 'name' => array('yes', 'like'),
  334. 'cate_id' => 'yes',
  335. 'uid' => 'yes',
  336. ),
  337. 'type' => 'all',
  338. 'order' => array('id', 'desc'),
  339. 'page' => array($page, 'list'),
  340. 'col' => '*',
  341. ),
  342. # 获取热门主题
  343. 'hot' => array
  344. (
  345. # 匹配的正则或函数 选填项
  346. 'option' => array
  347. (
  348. 'cate_id' => 'yes',
  349. 'uid' => 'yes',
  350. ),
  351. 'type' => 'all',
  352. 'order' => array('num_view`+`num_add_view' => 'desc', 'id' => 'desc'),
  353. 'page' => array($page, 'list'),
  354. 'col' => '*',
  355. ),
  356. # 获取冷门主题
  357. 'cold' => array
  358. (
  359. # 匹配的正则或函数 选填项
  360. 'option' => array
  361. (
  362. 'cate_id' => 'yes',
  363. 'uid' => 'yes',
  364. ),
  365. 'type' => 'all',
  366. 'order' => array('num_view`+`num_add_view' => 'asc', 'id' => 'desc'),
  367. 'page' => array($page, 'list'),
  368. 'col' => '*',
  369. ),
  370. # 更新浏览量
  371. 'addView' => array
  372. (
  373. 'type' => 'update',
  374. 'where' => array
  375. (
  376. 'id' => 'yes',
  377. ),
  378. 'set' => array
  379. (
  380. 'num_view' => array('1', '+='),
  381. ),
  382. ),
  383. # 更新回复数
  384. 'addComment' => array
  385. (
  386. 'type' => 'update',
  387. 'where' => array
  388. (
  389. 'id' => 'yes',
  390. ),
  391. 'set' => array
  392. (
  393. 'num_comment' => array('1', '+='),
  394. ),
  395. ),
  396. # 更新点赞数
  397. 'addUp' => array
  398. (
  399. 'type' => 'update',
  400. 'where' => array
  401. (
  402. 'id' => 'yes',
  403. ),
  404. 'set' => array
  405. (
  406. 'num_up' => array('1', '+='),
  407. ),
  408. ),
  409. # 更新点赞数
  410. 'desUp' => array
  411. (
  412. 'type' => 'update',
  413. 'where' => array
  414. (
  415. 'id' => 'yes',
  416. ),
  417. 'set' => array
  418. (
  419. 'num_up' => array('1', '-='),
  420. ),
  421. ),
  422. ),
  423. );