info.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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,ROUND((num_ding+num_add_ding)*num_ratio_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_ratio_ding' => array
  162. (
  163. 'type' => 'varchar-20',
  164. 'name' => '订阅系数-系数不能小于等于0,支持两位小数,电子刊总订阅量=(用户当前订阅数+订阅基数)*订阅系数',
  165. 'default' => '1',
  166. 'desc' => '手动增加订阅系数',
  167. 'match' => 'option',
  168. 'update' => 'text',
  169. ),
  170. 'num_add_ding' => array
  171. (
  172. 'type' => 'int-11',
  173. 'name' => '订阅基数',
  174. 'default' => '0',
  175. 'desc' => '手动增加阅读数',
  176. 'match' => 'option',
  177. 'update' => 'text',
  178. ),
  179. 'num_ding' => array
  180. (
  181. 'type' => 'int-11',
  182. 'name' => '订阅数',
  183. 'default' => '0',
  184. 'desc' => '请填写订阅数',
  185. 'match' => 'option',
  186. 'search' => 'order',
  187. //'list' => '{num_view}+{num_add_view}',
  188. ),
  189. 'num_add_view' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '阅读数基数',
  193. 'default' => '0',
  194. 'desc' => '手动增加阅读数',
  195. 'match' => 'option',
  196. 'update' => 'text',
  197. ),
  198. 'num_view' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '阅读数',
  202. 'default' => '0',
  203. 'desc' => '请填写阅读数',
  204. 'match' => 'option',
  205. 'search' => 'order',
  206. //'list' => '{num_view}+{num_add_view}',
  207. ),
  208. 'num_add_up' => array
  209. (
  210. 'type' => 'int-11',
  211. 'name' => '喜欢基数',
  212. 'default' => '0',
  213. 'desc' => '喜欢基数',
  214. 'match' => 'option',
  215. //'update' => 'text',
  216. ),
  217. 'num_up' => array
  218. (
  219. 'type' => 'int-11',
  220. 'name' => '喜欢数',
  221. 'default' => '0',
  222. 'desc' => '请填写喜欢数',
  223. 'match' => 'option',
  224. //'search' => 'order',
  225. 'list' => '"订阅数:({num_ding}+{num_add_ding})*{num_ratio_ding}=".round(({num_ding}+{num_add_ding})*{num_ratio_ding})."<br />阅读数:{num_view}+{num_add_view}<br />评论数:{num_comment}<br />"',
  226. 'list_name' => '统计数字',
  227. ),
  228. 'num_comment' => array
  229. (
  230. 'type' => 'int-11',
  231. 'name' => '评论数',
  232. 'default' => '0',
  233. 'desc' => '请填写评论数',
  234. 'search' => 'order',
  235. 'match' => 'option',
  236. //'list' => true,
  237. ),
  238. 'state' => array
  239. (
  240. 'type' => 'tinyint-1',
  241. 'name' => '状态',
  242. 'default' => '1',
  243. 'desc' => '请选择状态',
  244. 'match' => 'is_numeric',
  245. ),
  246. 'audit' => array
  247. (
  248. 'type' => 'int-11',
  249. 'name' => '审核',
  250. 'default' => '1',
  251. 'desc' => '审核',
  252. 'match' => 'is_numeric',
  253. //'update' => 'select',
  254. 'option' => $audit,
  255. //'search' => 'select',
  256. //'list' => true,
  257. //'edit' => true,
  258. ),
  259. 'status' => array
  260. (
  261. 'type' => 'int-11',
  262. 'name' => '上线状态',
  263. 'default' => '1',
  264. 'desc' => '上线状态',
  265. 'match' => 'is_numeric',
  266. //'update' => 'select',
  267. 'option' => $status,
  268. 'search' => 'select',
  269. 'list' => true,
  270. 'edit' => true,
  271. ),
  272. 'admin_founder' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '创建人',
  276. 'default' => '1',
  277. 'desc' => '创建人',
  278. 'match' => 'is_numeric',
  279. ),
  280. 'admin_editor' => array
  281. (
  282. 'type' => 'int-11',
  283. 'name' => '操作人',
  284. 'default' => '1',
  285. 'desc' => '操作人',
  286. 'match' => 'is_numeric',
  287. ),
  288. 'pdate' => array
  289. (
  290. 'type' => 'int-11',
  291. 'name' => '发布时间',
  292. 'match' => array('is_numeric', time()),
  293. 'default' => '',
  294. 'desc' => '',
  295. 'update' => 'date',
  296. 'callback' => 'maketime',
  297. 'insert' => true,
  298. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  299. 'auth' => '"{pdate}" > 0',
  300. ),
  301. 'share' => array
  302. (
  303. 'type' => 'text-255',
  304. 'name' => '分享海报-选择海报库中的海报',
  305. 'default' => '',
  306. 'desc' => '分享海报',
  307. 'match' => 'option',
  308. //'update' => 'checkbox',
  309. 'option' => $share,
  310. ),
  311. 'buy' => array
  312. (
  313. 'type' => 'int-11',
  314. 'name' => '是否收费',
  315. 'default' => '1',
  316. 'desc' => '是否收费',
  317. 'match' => 'option',
  318. 'update' => 'radio',
  319. 'option' => $buy,
  320. 'control' => 'buy',
  321. 'list' => true,
  322. 'search' => 'select',
  323. ),
  324. 'cash' => array
  325. (
  326. 'type' => 'varchar-50',
  327. 'name' => '单本支付价格-实际的小刊单本支付价格,单位元,直接填写数字即可',
  328. 'default' => '',
  329. 'desc' => '支付价格',
  330. 'match' => 'is_string',
  331. 'update' => 'text',
  332. 'show' => 'buy=1',
  333. ),
  334. 'score' => array
  335. (
  336. 'type' => 'varchar-80',
  337. 'name' => '购买增加积分数-直接填写购买单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  338. 'default' => '20',
  339. 'desc' => '增加积分数',
  340. 'match' => 'is_string',
  341. 'update' => 'text',
  342. 'show' => 'buy=1',
  343. ),
  344. 'dh_score' => array
  345. (
  346. 'type' => 'varchar-80',
  347. 'name' => '兑换增加积分数-直接填写兑换单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  348. 'default' => '20',
  349. 'desc' => '增加积分数',
  350. 'match' => 'is_string',
  351. 'update' => 'text',
  352. 'show' => 'buy=1',
  353. ),
  354. 'share_yes' => array
  355. (
  356. 'type' => 'int-11',
  357. 'name' => '是否显示分享按钮',
  358. 'default' => '1',
  359. 'desc' => '是否显示分享按钮',
  360. 'match' => 'option',
  361. 'update' => 'radio',
  362. 'option' => $share,
  363. 'control' => 'share_yes',
  364. ),
  365. 'share_title' => array
  366. (
  367. 'type' => 'varchar-100',
  368. 'name' => '分享标题',
  369. 'default' => '',
  370. 'desc' => '分享标题',
  371. 'match' => 'option',
  372. 'update' => 'text',
  373. 'show' => 'share_yes=1',
  374. ),
  375. 'share_pic' => array
  376. (
  377. 'type' => 'varchar-150',
  378. 'name' => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  379. 'default' => '',
  380. 'desc' => '分享图片',
  381. 'match' => 'is_string',
  382. 'update' => 'image',
  383. 'key' => '1',
  384. 'place' => '150',
  385. 'show' => 'share_yes=1',
  386. //'upload' => 'qiniu',
  387. //'large' => true,
  388. ),
  389. 'share_content' => array
  390. (
  391. 'type' => 'varchar-200',
  392. 'name' => '分享内容',
  393. 'default' => '',
  394. 'desc' => '分享内容',
  395. 'match' => 'option',
  396. 'update' => 'textarea',
  397. 'show' => 'share_yes=1',
  398. ),
  399. 'reorder' => array
  400. (
  401. 'type' => 'int-11',
  402. 'name' => '排序(数值越大越靠前)',
  403. 'default' => '1',
  404. 'desc' => '请输入排序',
  405. 'match' => 'option',
  406. 'update' => 'text',
  407. 'search' => 'order',
  408. 'list' => true,
  409. 'order' => 'desc',
  410. 'edit' => true,
  411. ),
  412. 'udate' => array
  413. (
  414. 'type' => 'int-11',
  415. 'name' => '更新时间',
  416. 'match' => array('is_numeric', time()),
  417. 'desc' => '',
  418. ),
  419. 'cdate' => array
  420. (
  421. 'type' => 'int-11',
  422. 'name' => '录入时间',
  423. 'match' => array('is_numeric', time()),
  424. 'desc' => '',
  425. # 只有insert时才生效
  426. 'insert' => true,
  427. ),
  428. ),
  429. # 管理功能
  430. 'manage' => array
  431. (
  432. //'insert' => false,
  433. 'delete' => false,
  434. # 列表
  435. 'list_button' => array
  436. (
  437. 'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
  438. 'edit1' => array('活动预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=13'))),
  439. 'br2' => array('<br />'),
  440. 'list10' => array('积分排行', '"score&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"'),
  441. 'list11' => array('邀请排行', '"invite&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"'),
  442. 'br1' => array('<br />'),
  443. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  444. 'br2' => array('<br />'),
  445. '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'),
  446. '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'),
  447. 'br3' => array('<br />'),
  448. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
  449. ),
  450. ),
  451. # request 请求接口定义
  452. 'request' => array
  453. (
  454. 'search' => array
  455. (
  456. # 匹配的正则或函数 选填项
  457. 'option' => array
  458. (
  459. 'ids' => array('yes-id', 'in'),
  460. //'cate_id' => 'yes',
  461. 'name' => array('yes', 'like'),
  462. 'id' => 'yes',
  463. 'state' => 1,
  464. ),
  465. 'type' => 'all',
  466. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  467. 'limit' => '0,1000',
  468. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  469. ),
  470. 'getAll' => array
  471. (
  472. # 匹配的正则或函数 选填项
  473. 'option' => array
  474. (
  475. //'audit' => 2,
  476. 'buy' => 'yes',
  477. 'cate_id' => 'yes',
  478. 'status' => 2,
  479. 'state' => 1,
  480. ),
  481. 'type' => 'all',
  482. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  483. //'page' => array(10, 'list'),
  484. 'col' => $col,
  485. ),
  486. # 更新浏览量
  487. 'addView' => array
  488. (
  489. 'type' => 'update',
  490. 'where' => array
  491. (
  492. 'id' => 'yes',
  493. ),
  494. 'set' => array
  495. (
  496. 'num_view' => array('1', '+='),
  497. ),
  498. ),
  499. ),
  500. );