info.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. <?php
  2. $time = (7*86400);
  3. $audit = Dever::config('base')->audit;
  4. $status = Dever::config('base')->status;
  5. $share = function()
  6. {
  7. $array = array();
  8. $info = Dever::db('poster/template')->state();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. # 获取小刊分类权限
  16. $auth = Dever::tops();
  17. $cate = function() use ($auth)
  18. {
  19. $array = array();
  20. if ($auth) {
  21. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  22. } else {
  23. $info = Dever::db('journal/cate')->state();
  24. }
  25. if($info)
  26. {
  27. $array += $info;
  28. }
  29. return $array;
  30. };
  31. $share = array
  32. (
  33. 1 => '显示',
  34. 2 => '不显示',
  35. );
  36. $publish = array
  37. (
  38. 1 => '小程序',
  39. 2 => 'APP',
  40. );
  41. $top = array
  42. (
  43. 1 => '显示',
  44. 2 => '不显示',
  45. );
  46. $buy = array
  47. (
  48. 1 => '收费',
  49. 2 => '免费',
  50. //3 => '会员',
  51. );
  52. $buy_type = array
  53. (
  54. 1 => '普通支付',
  55. 2 => '按明星支付',
  56. );
  57. $hot = array
  58. (
  59. 1 => '热门',
  60. 2 => '普通',
  61. );
  62. $page = 15;
  63. # 常用的col
  64. $col = 'id,name,subname,pic_cover,pic_view_cover,pic_view_bg,pdate,num_view,num_ding,num_add_ding,num_ratio_ding,num_comment,num_up,buy,share_yes,share_title,share_pic,share_content,pic_gd,cate_id,cash,bgmusic,top,hot,h5,publish,buy_type';
  65. $config = array
  66. (
  67. # 表名
  68. 'name' => 'info',
  69. # 显示给用户看的名称
  70. 'lang' => '小刊管理',
  71. 'order' => 100,
  72. 'end' => array
  73. (
  74. 'insert' => 'journal/lib/manage.setJournalCache',
  75. 'update' => 'journal/lib/manage.setJournalCache',
  76. 'update_status' => 'journal/lib/manage.setJournalCache',
  77. ),
  78. # 同步更新另外一个或多个表的数据 小刊不需要同步到审核页面
  79. /*
  80. 'syncone' => array
  81. (
  82. 'audit/data' => array
  83. (
  84. # 更新另外一个表的字段 => 本表的字段
  85. 'where' => array('data_id' => 'id', 'type' => 4),
  86. # 要更新的数据
  87. 'update' => array('data_id' => 'id', 'type' => 4, 'pdate' => 'pdate', 'reorder' => 'reorder', 'name' => 'name', 'audit' => 'audit', 'state' => 'state'),
  88. )
  89. ),
  90. */
  91. # 数据结构
  92. 'struct' => array
  93. (
  94. 'id' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => 'ID',
  98. 'default' => '',
  99. 'desc' => '',
  100. 'match' => 'is_numeric',
  101. 'list' => true,
  102. ),
  103. 'name' => array
  104. (
  105. 'type' => 'varchar-180',
  106. 'name' => '小刊标题',
  107. 'default' => '',
  108. 'desc' => '标题',
  109. 'match' => 'is_string',
  110. 'update' => 'text',
  111. 'search' => 'fulltext',
  112. 'list' => true,
  113. ),
  114. 'subname' => array
  115. (
  116. 'type' => 'varchar-80',
  117. 'name' => '子标题-一般为杂志的期数,如第1期',
  118. 'default' => '',
  119. 'desc' => '子标题',
  120. 'match' => 'is_string',
  121. 'update' => 'text',
  122. //'list' => true,
  123. ),
  124. 'cate_id' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '小刊分类',
  128. 'default' => '1',
  129. 'desc' => '小刊分类',
  130. 'match' => 'is_numeric',
  131. 'update' => 'select',
  132. 'option' => $cate,
  133. 'search' => 'select',
  134. //'list' => true,
  135. ),
  136. 'h5' => array
  137. (
  138. 'type' => 'varchar-800',
  139. 'name' => 'h5地址-填写后,直接跳转到该页面',
  140. 'default' => '',
  141. 'desc' => 'h5地址',
  142. 'match' => 'option',
  143. 'update' => 'textarea',
  144. //'search' => 'fulltext',
  145. //'list' => true,
  146. ),
  147. 'pic_cover' => array
  148. (
  149. 'type' => 'varchar-150',
  150. 'name' => '列表页封面图-4:3比例的图片',
  151. 'default' => '',
  152. 'desc' => '列表封面图',
  153. 'match' => 'is_string',
  154. //'update' => 'image',
  155. 'key' => '1',
  156. 'place' => '150',
  157. ),
  158. 'pic_view_cover' => array
  159. (
  160. 'type' => 'varchar-150',
  161. 'name' => '封面图-图片尺寸660*660px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  162. 'default' => '',
  163. 'desc' => '封面图',
  164. 'match' => 'is_string',
  165. 'update' => 'image',
  166. 'key' => '1',
  167. 'place' => '150',
  168. ),
  169. 'pic_view_bg' => array
  170. (
  171. 'type' => 'text-255',
  172. 'name' => '全屏背景图-图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  173. 'default' => '',
  174. 'desc' => '全屏背景图',
  175. 'match' => 'is_string',
  176. 'update' => 'images',
  177. 'key' => '1',
  178. 'place' => '150',
  179. ),
  180. 'pic_gd' => array
  181. (
  182. 'type' => 'varchar-150',
  183. 'name' => '小刊推广图-图片尺寸512*688px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  184. 'default' => '',
  185. 'desc' => '小刊推广图',
  186. 'match' => 'is_string',
  187. 'update' => 'image',
  188. 'key' => '1',
  189. 'place' => '150',
  190. ),
  191. 'bgmusic' => array
  192. (
  193. 'type' => 'varchar-800',
  194. 'name' => '背景音乐-音频格式mp3,上传大小不能超过100M',
  195. 'default' => '',
  196. 'desc' => '背景音乐',
  197. 'match' => 'option',
  198. 'update' => 'upload',
  199. 'key' => '2',
  200. 'place' => '150',
  201. 'upload' => 'qiniu',
  202. 'large' => true,
  203. //不覆盖原文件,生成新文件
  204. 'cover' => 2,
  205. ),
  206. 'num_ding' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '订阅数',
  210. 'default' => '0',
  211. 'desc' => '请填写订阅数',
  212. 'match' => 'option',
  213. 'search' => 'order',
  214. //'list' => '{num_view}+{num_add_view}',
  215. ),
  216. 'num_add_view' => array
  217. (
  218. 'type' => 'int-11',
  219. 'name' => '阅读数基数-废弃',
  220. 'default' => '0',
  221. 'desc' => '手动增加阅读数',
  222. 'match' => 'option',
  223. //'update' => 'text',
  224. ),
  225. 'num_view' => array
  226. (
  227. 'type' => 'int-11',
  228. 'name' => '阅读数-废弃',
  229. 'default' => '0',
  230. 'desc' => '请填写阅读数',
  231. 'match' => 'option',
  232. 'search' => 'order',
  233. //'list' => '{num_view}+{num_add_view}',
  234. ),
  235. 'num_add_up' => array
  236. (
  237. 'type' => 'int-11',
  238. 'name' => '喜欢基数-废弃',
  239. 'default' => '0',
  240. 'desc' => '喜欢基数',
  241. 'match' => 'option',
  242. //'update' => 'text',
  243. ),
  244. 'num_up' => array
  245. (
  246. 'type' => 'int-11',
  247. 'name' => '喜欢数-已更新为订阅数,当使用通用兑换码时以及阅读时使用',
  248. 'default' => '0',
  249. 'desc' => '请填写喜欢数',
  250. 'match' => 'option',
  251. //'search' => 'order',
  252. 'list' => 'Dever::load("journal/lib/manage.ding?id={id}")',
  253. 'list_name' => '统计数字',
  254. ),
  255. 'num_comment' => array
  256. (
  257. 'type' => 'int-11',
  258. 'name' => '评论数-废弃',
  259. 'default' => '0',
  260. 'desc' => '请填写评论数',
  261. 'search' => 'order',
  262. 'match' => 'option',
  263. //'list' => true,
  264. ),
  265. 'state' => array
  266. (
  267. 'type' => 'tinyint-1',
  268. 'name' => '状态',
  269. 'default' => '1',
  270. 'desc' => '请选择状态',
  271. 'match' => 'is_numeric',
  272. ),
  273. 'audit' => array
  274. (
  275. 'type' => 'int-11',
  276. 'name' => '审核',
  277. 'default' => '1',
  278. 'desc' => '审核',
  279. 'match' => 'is_numeric',
  280. //'update' => 'select',
  281. 'option' => $audit,
  282. //'search' => 'select',
  283. //'list' => true,
  284. //'edit' => true,
  285. ),
  286. 'status' => array
  287. (
  288. 'type' => 'int-11',
  289. 'name' => '上线状态',
  290. 'default' => '1',
  291. 'desc' => '上线状态',
  292. 'match' => 'is_numeric',
  293. //'update' => 'select',
  294. 'option' => $status,
  295. 'search' => 'select',
  296. 'list' => true,
  297. 'edit' => true,
  298. ),
  299. 'admin_founder' => array
  300. (
  301. 'type' => 'int-11',
  302. 'name' => '创建人',
  303. 'default' => '1',
  304. 'desc' => '创建人',
  305. 'match' => 'is_numeric',
  306. ),
  307. 'admin_editor' => array
  308. (
  309. 'type' => 'int-11',
  310. 'name' => '操作人',
  311. 'default' => '1',
  312. 'desc' => '操作人',
  313. 'match' => 'is_numeric',
  314. ),
  315. 'pdate' => array
  316. (
  317. 'type' => 'int-11',
  318. 'name' => '发售时间',
  319. 'match' => array('is_numeric', time()),
  320. 'default' => '',
  321. 'desc' => '',
  322. 'update' => 'date',
  323. 'callback' => 'maketime',
  324. 'insert' => true,
  325. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  326. 'auth' => '"{pdate}" > 0',
  327. ),
  328. 'ydate' => array
  329. (
  330. 'type' => 'int-11',
  331. 'name' => '预售时间',
  332. 'match' => 'option',
  333. 'default' => '',
  334. 'desc' => '',
  335. //'update' => 'date',
  336. 'callback' => 'maketime',
  337. //'insert' => true,
  338. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  339. //'auth' => '"{ydate}" > 0',
  340. ),
  341. 'publish' => array
  342. (
  343. 'type' => 'varchar-10',
  344. 'name' => '发布位置',
  345. 'default' => '1,2',
  346. 'desc' => '发布位置',
  347. 'match' => 'option',
  348. 'update' => 'checkbox',
  349. 'option' => $publish,
  350. ),
  351. 'share' => array
  352. (
  353. 'type' => 'text-255',
  354. 'name' => '分享海报-选择海报库中的海报',
  355. 'default' => '',
  356. 'desc' => '分享海报',
  357. 'match' => 'option',
  358. //'update' => 'checkbox',
  359. 'option' => $share,
  360. ),
  361. 'top' => array
  362. (
  363. 'type' => 'tinyint-11',
  364. 'name' => '是否显示排行榜',
  365. 'default' => '1',
  366. 'desc' => '是否显示排行榜',
  367. 'match' => 'option',
  368. 'update' => 'radio',
  369. 'option' => $top,
  370. 'list' => true,
  371. 'search' => 'select',
  372. 'edit' => true,
  373. ),
  374. 'buy' => array
  375. (
  376. 'type' => 'int-11',
  377. 'name' => '是否收费',
  378. 'default' => '1',
  379. 'desc' => '是否收费',
  380. 'match' => 'option',
  381. 'update' => 'radio',
  382. 'option' => $buy,
  383. 'control' => 'buy',
  384. //'list' => true,
  385. 'search' => 'select',
  386. ),
  387. 'buy_type' => array
  388. (
  389. 'type' => 'int-11',
  390. 'name' => '支付类型',
  391. 'default' => '1',
  392. 'desc' => '支付类型',
  393. 'match' => 'option',
  394. 'update' => 'radio',
  395. 'option' => $buy_type,
  396. 'control' => 'buy_type',
  397. 'show' => 'buy=1',
  398. ),
  399. 'num_ratio_ding' => array
  400. (
  401. 'type' => 'varchar-20',
  402. 'name' => '订阅系数-系数不能小于等于0,支持两位小数,电子刊总订阅量=(用户当前订阅数+订阅基数)*订阅系数。注意:如果设置了明星,这里设置将失效',
  403. 'default' => '1',
  404. 'desc' => '手动增加订阅系数',
  405. 'match' => 'is_string',
  406. 'update' => 'text',
  407. 'show' => 'buy=1&buy_type=1',
  408. ),
  409. 'num_add_ding' => array
  410. (
  411. 'type' => 'int-11',
  412. 'name' => '订阅基数-注意:如果设置了明星,这里设置将失效',
  413. 'default' => '0',
  414. 'desc' => '手动增加阅读数',
  415. 'match' => 'option',
  416. 'update' => 'text',
  417. 'show' => 'buy=1&buy_type=1',
  418. ),
  419. 'hot' => array
  420. (
  421. 'type' => 'tinyint-1',
  422. 'name' => '是否热门电子刊',
  423. 'default' => '2',
  424. 'desc' => '是否热门电子刊',
  425. 'match' => 'option',
  426. 'update' => 'radio',
  427. 'option' => $hot,
  428. 'search' => 'select',
  429. 'list' => true,
  430. 'edit' => true,
  431. ),
  432. 'cash' => array
  433. (
  434. 'type' => 'varchar-50',
  435. 'name' => '单本支付价格-实际的小刊单本支付价格,单位元,直接填写数字即可',
  436. 'default' => '',
  437. 'desc' => '支付价格',
  438. 'match' => 'is_string',
  439. 'update' => 'text',
  440. 'show' => 'buy=1',
  441. ),
  442. 'buy_content' => array
  443. (
  444. 'type' => 'text-255',
  445. 'name' => '购买说明',
  446. 'default' => "<p>
  447. 1、兑换成功后可直接点击【阅读】查看电子刊内容;&nbsp;
  448. </p>
  449. <p>
  450. 2、电子刊为虚拟商品,如无系统问题,兑换后不可退款;
  451. </p>
  452. <p>
  453. &nbsp;3、购买多少本就会生成多少兑换码,每个兑换码只能被激活一次;
  454. </p>
  455. <p>
  456. &nbsp;4、当购买成功后,系统会自动激活一个兑换码;&nbsp;
  457. </p>
  458. <p>
  459. 5、若您购买了多本,可将剩余兑换码赠送好友;
  460. </p>
  461. <p>
  462. &nbsp;6、如有其它问题可咨询在线客服。
  463. </p>",
  464. 'desc' => '请输入内容',
  465. 'match' => 'is_string',
  466. 'update' => 'editor',
  467. 'key' => 1,
  468. 'show' => 'buy=1',
  469. ),
  470. 'score' => array
  471. (
  472. 'type' => 'varchar-80',
  473. 'name' => '购买增加积分数-直接填写购买单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  474. 'default' => '20',
  475. 'desc' => '增加积分数',
  476. 'match' => 'is_string',
  477. 'update' => 'text',
  478. 'show' => 'buy=1',
  479. ),
  480. 'dh_score' => array
  481. (
  482. 'type' => 'varchar-80',
  483. 'name' => '兑换增加积分数-直接填写兑换单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  484. 'default' => '20',
  485. 'desc' => '增加积分数',
  486. 'match' => 'is_string',
  487. 'update' => 'text',
  488. 'show' => 'buy=1',
  489. ),
  490. 'share_yes' => array
  491. (
  492. 'type' => 'int-11',
  493. 'name' => '是否显示分享按钮',
  494. 'default' => '1',
  495. 'desc' => '是否显示分享按钮',
  496. 'match' => 'option',
  497. 'update' => 'radio',
  498. 'option' => $share,
  499. 'control' => 'share_yes',
  500. ),
  501. 'share_title' => array
  502. (
  503. 'type' => 'varchar-100',
  504. 'name' => '分享标题',
  505. 'default' => '',
  506. 'desc' => '分享标题',
  507. 'match' => 'option',
  508. 'update' => 'text',
  509. 'show' => 'share_yes=1',
  510. ),
  511. 'share_pic' => array
  512. (
  513. 'type' => 'varchar-150',
  514. 'name' => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  515. 'default' => '',
  516. 'desc' => '分享图片',
  517. 'match' => 'is_string',
  518. 'update' => 'image',
  519. 'key' => '1',
  520. 'place' => '150',
  521. 'show' => 'share_yes=1',
  522. //'upload' => 'qiniu',
  523. //'large' => true,
  524. ),
  525. 'share_content' => array
  526. (
  527. 'type' => 'varchar-200',
  528. 'name' => '分享内容',
  529. 'default' => '',
  530. 'desc' => '分享内容',
  531. 'match' => 'option',
  532. 'update' => 'textarea',
  533. 'show' => 'share_yes=1',
  534. ),
  535. 'reorder' => array
  536. (
  537. 'type' => 'int-11',
  538. 'name' => '排序(数值越大越靠前)',
  539. 'default' => '1',
  540. 'desc' => '请输入排序',
  541. 'match' => 'option',
  542. 'update' => 'text',
  543. 'search' => 'order',
  544. 'list' => true,
  545. 'order' => 'desc',
  546. 'edit' => true,
  547. ),
  548. 'udate' => array
  549. (
  550. 'type' => 'int-11',
  551. 'name' => '更新时间',
  552. 'match' => array('is_numeric', time()),
  553. 'desc' => '',
  554. ),
  555. 'cdate' => array
  556. (
  557. 'type' => 'int-11',
  558. 'name' => '录入时间',
  559. 'match' => array('is_numeric', time()),
  560. 'desc' => '',
  561. # 只有insert时才生效
  562. 'insert' => true,
  563. ),
  564. ),
  565. 'top' => Dever::config('base')->top,
  566. # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
  567. 'top_option' => array
  568. (
  569. array
  570. (
  571. 'value' => $auth,
  572. 'col' => 'cate_id',
  573. ),
  574. array
  575. (
  576. 'value' => Dever::load('manage/auth.authData'),
  577. 'col' => 'id',
  578. ),
  579. ),
  580. # 管理功能
  581. 'manage' => array
  582. (
  583. //'insert' => false,
  584. 'delete' => false,
  585. # 列表
  586. 'list_button' => array
  587. (
  588. /*
  589. 'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
  590. 'edit1' => array('活动预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=13')), '{audit} == 1 && {buy} == 1'),
  591. 'br2' => array('<br />'),
  592. 'list10' => array('排行榜', '"journal_num&project=act&search_type=4&search_option_journal_id={id}&oper_parent=info&oper_project=journal"' , '{audit} == 1 && {buy} == 1'),
  593. 'list11' => array('积分排行榜(旧)', '"score&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"', '{audit} == 1 && {buy} == 1'),
  594. //'list11' => array('邀请排行', '"invite&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"'),
  595. 'br1' => array('<br />'),
  596. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  597. 'br2' => array('<br />'),
  598. '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 && {buy} == 1'),
  599. '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 && {buy} == 1'),
  600. 'br3' => array('<br />'),
  601. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
  602. 'list2' => array('购买明星设置', '"star&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1 && {buy_type} == 2'),
  603. */
  604. 'update' => '编辑电子刊',
  605. 'br1' => array('<br />'),
  606. 'edit' => array('电子刊预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
  607. 'edit1' => array('活动预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=13')), '{audit} == 1 && {buy} == 1'),
  608. 'br2' => array('<br />'),
  609. 'list10' => array('排行榜', '"journal_num&project=act&search_type=4&search_option_journal_id={id}&oper_parent=info&oper_project=journal"' , '{audit} == 1 && {buy} == 1'),
  610. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  611. //'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 && {buy} == 1'),
  612. '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 && {buy} == 1'),
  613. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
  614. 'list2' => array('购买明星设置', '"star&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1 && {buy_type} == 2'),
  615. ),
  616. ),
  617. # request 请求接口定义
  618. 'request' => array
  619. (
  620. 'search' => array
  621. (
  622. # 匹配的正则或函数 选填项
  623. 'option' => array
  624. (
  625. 'ids' => array('yes-id', 'in'),
  626. 'cate_id' => 'yes',
  627. 'name' => array('yes', 'like'),
  628. 'id' => 'yes',
  629. 'state' => 1,
  630. ),
  631. 'type' => 'all',
  632. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  633. 'limit' => '0,1000',
  634. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  635. ),
  636. 'getAll' => array
  637. (
  638. # 匹配的正则或函数 选填项
  639. 'option' => array
  640. (
  641. //'audit' => 2,
  642. 'buy' => 'yes',
  643. 'cate_id' => 'yes',
  644. 'publish' => array('yes', 'like'),
  645. 'status' => 2,
  646. 'state' => 1,
  647. ),
  648. 'type' => 'all',
  649. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  650. //'page' => array(10, 'list'),
  651. 'col' => $col,
  652. ),
  653. 'getAllByPage' => array
  654. (
  655. # 匹配的正则或函数 选填项
  656. 'option' => array
  657. (
  658. //'audit' => 2,
  659. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  660. 'time' => array('yes-pdate', '<=', 'or)'),
  661. 'publish' => array('yes', 'like'),
  662. 'buy' => 'yes',
  663. 'cate_id' => 'yes',
  664. 'status' => 2,
  665. 'state' => 1,
  666. ),
  667. 'type' => 'all',
  668. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  669. 'page' => array(10, 'list'),
  670. 'col' => $col,
  671. ),
  672. # 更新浏览量
  673. 'addView' => array
  674. (
  675. 'type' => 'update',
  676. 'where' => array
  677. (
  678. 'id' => 'yes',
  679. ),
  680. 'set' => array
  681. (
  682. 'num_view' => array('1', '+='),
  683. ),
  684. ),
  685. # 更新订阅量
  686. 'addDing' => array
  687. (
  688. 'type' => 'update',
  689. 'where' => array
  690. (
  691. 'id' => 'yes',
  692. ),
  693. 'set' => array
  694. (
  695. 'num_up' => array('1', '+='),
  696. ),
  697. ),
  698. 'getIds' => array
  699. (
  700. # 匹配的正则或函数 选填项
  701. 'option' => array
  702. (
  703. 'cate_id' => array('yes-cate_id', 'in'),
  704. 'state' => 1,
  705. ),
  706. 'type' => 'all',
  707. 'order' => array('reorder' => 'desc', 'pdate' => 'desc','id' => 'desc'),
  708. 'col' => '*,id as value|id',
  709. ),
  710. 'getOne' => array
  711. (
  712. # 匹配的正则或函数 选填项
  713. 'option' => array
  714. (
  715. 'id' => 'yes',
  716. 'publish' => array('yes', 'like'),
  717. 'state' => 1,
  718. ),
  719. 'type' => 'one',
  720. 'col' => $col,
  721. ),
  722. # 热门
  723. 'getHot' => array
  724. (
  725. # 匹配的正则或函数 选填项
  726. 'option' => array
  727. (
  728. //'audit' => 2,
  729. 'hot' => 1,
  730. 'buy' => 'yes',
  731. 'time' => array('yes-pdate', '<=', 'or)'),
  732. 'publish' => array('yes', 'like'),
  733. 'buy_type' => 'yes',
  734. 'cate_id' => 'yes',
  735. 'status' => 2,
  736. 'state' => 1,
  737. ),
  738. 'type' => 'all',
  739. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  740. //'page' => array(10, 'list'),
  741. 'col' => $col,
  742. ),
  743. 'getNew' => array
  744. (
  745. # 匹配的正则或函数 选填项
  746. 'option' => array
  747. (
  748. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  749. 'time' => array('yes-pdate', '<=', 'or)'),
  750. 'cate_id' => 'yes',
  751. 'publish' => array('yes', 'like'),
  752. 'status' => 2,
  753. 'state' => 1,
  754. ),
  755. 'type' => 'one',
  756. 'order' => array('ssdate' => 'desc'),
  757. 'col' => $col . ',case when cate_id = 1 then pdate else pdate-'.$time.' end as ssdate',
  758. ),
  759. ),
  760. );
  761. /* 由top_option取代
  762. if ($auth) {
  763. $config['request']['list'] = array
  764. (
  765. 'type' => 'all',
  766. 'order' => array('id' => 'desc'),
  767. 'col' => '*|id',
  768. 'page' => array(15, 'list'),
  769. 'option' => array
  770. (
  771. 'cate_id' => array($auth, 'in'),
  772. ),
  773. );
  774. }
  775. */
  776. return $config;