info.php 21 KB

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