info.php 10 KB

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