info.php 13 KB

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