info.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. <?php
  2. $time = (7*86400);
  3. $audit = Dever::config('base')->audit;
  4. $status = Dever::config('base')->status;
  5. # 分类权限
  6. $auth = Dever::tops();
  7. $cate = function() use ($auth)
  8. {
  9. $array = array();
  10. if ($auth) {
  11. $info = Dever::db('collection/cate')->getIds(array('ids' => $auth));
  12. } else {
  13. $info = Dever::db('collection/cate')->state();
  14. }
  15. if($info)
  16. {
  17. $array += $info;
  18. }
  19. return $array;
  20. };
  21. $score = function()
  22. {
  23. $array = array();
  24. $info = Dever::db('score/config')->state(array('type' => 3));
  25. if($info)
  26. {
  27. $array += $info;
  28. }
  29. return $array;
  30. };
  31. $score_type = array
  32. (
  33. 1 => '全局积分',
  34. 2 => '私有积分',
  35. );
  36. $buy = array
  37. (
  38. 1 => '收费',
  39. 2 => '免费',
  40. );
  41. $page = 15;
  42. # 常用的col
  43. $col = '*';
  44. $config = array
  45. (
  46. # 表名
  47. 'name' => 'info',
  48. # 显示给用户看的名称
  49. 'lang' => '合集列表',
  50. 'order' => 100,
  51. 'end' => array
  52. (
  53. 'insert' => 'collection/lib/manage.setInfo',
  54. 'update' => 'collection/lib/manage.setInfo',
  55. 'update_status' => 'collection/lib/manage.setInfo',
  56. ),
  57. # 数据结构
  58. 'struct' => array
  59. (
  60. 'id' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => 'ID',
  64. 'default' => '',
  65. 'desc' => '',
  66. 'match' => 'is_numeric',
  67. 'list' => true,
  68. ),
  69. 'hr1' => array
  70. (
  71. 'name' => '基本配置',
  72. 'class' => '',//本项必须填写
  73. 'attr' => '',
  74. ),
  75. 'name' => array
  76. (
  77. 'type' => 'varchar-180',
  78. 'name' => '标题-分享时作为默认标题',
  79. 'default' => '',
  80. 'desc' => '标题',
  81. 'match' => 'is_string',
  82. 'update' => 'text',
  83. 'search' => 'fulltext',
  84. 'list' => true,
  85. ),
  86. 'desc' => array
  87. (
  88. 'type' => 'varchar-800',
  89. 'name' => '描述-分享时作为默认描述',
  90. 'default' => '',
  91. 'desc' => '描述',
  92. 'match' => 'option',
  93. 'update' => 'textarea',
  94. //'list' => true,
  95. ),
  96. 'pic_cover' => array
  97. (
  98. 'type' => 'varchar-150',
  99. 'name' => '封面图-用作列表页的图片,也用作分享默认图片,图片尺寸660*660px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  100. 'default' => '',
  101. 'desc' => '封面图',
  102. 'match' => 'option',
  103. 'update' => 'image',
  104. 'key' => '1',
  105. 'place' => '660*660',
  106. ),
  107. 'cate_id' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '分类',
  111. 'default' => '1',
  112. 'desc' => '分类',
  113. 'match' => 'is_numeric',
  114. 'update' => 'select',
  115. 'option' => $cate,
  116. 'search' => 'select',
  117. //'list' => true,
  118. ),
  119. 'uid' => array
  120. (
  121. 'type' => 'int-11',
  122. 'name' => '作者',
  123. 'default' => '0',
  124. 'desc' => '请选择作者',
  125. 'match' => 'is_numeric',
  126. 'update' => 'select',
  127. 'update_search' => 'passport/lib/manage.search',
  128. //'search' => 'select',
  129. 'search' => array
  130. (
  131. 'api' => 'passport/user-all',
  132. 'col' => 'username',
  133. 'result' => 'id',
  134. ),
  135. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "官方"',
  136. ),
  137. 'author_name' => array
  138. (
  139. 'type' => 'varchar-50',
  140. 'name' => '作者称谓-默认为作者,可以改为店主之类的',
  141. 'default' => '作者',
  142. 'desc' => '作者称谓',
  143. 'match' => 'option',
  144. 'update' => 'text',
  145. ),
  146. 'logo' => array
  147. (
  148. 'type' => 'varchar-150',
  149. 'name' => 'LOGO图片-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  150. 'default' => '',
  151. 'desc' => 'LOGO图片',
  152. 'match' => 'option',
  153. //'update' => 'image',
  154. 'key' => '1',
  155. 'place' => '150*150',
  156. ),
  157. 'pic_bg' => array
  158. (
  159. 'type' => 'text-255',
  160. 'name' => '全屏背景图-可以上传多张,展示在合集首页,图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  161. 'default' => '',
  162. 'desc' => '全屏背景图',
  163. 'match' => 'option',
  164. 'update' => 'images',
  165. 'key' => '1',
  166. 'place' => '750*1386',
  167. ),
  168. 'bgmusic' => array
  169. (
  170. 'type' => 'varchar-800',
  171. 'name' => '背景音乐-音频格式mp3,上传大小不能超过100M',
  172. 'default' => '',
  173. 'desc' => '背景音乐',
  174. 'match' => 'option',
  175. //'update' => 'upload',
  176. 'key' => '2',
  177. 'place' => '150',
  178. 'upload' => 'yun',
  179. 'large' => true,
  180. ),
  181. 'pdate' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '开放时间',
  185. 'match' => array('is_numeric', time()),
  186. 'default' => '',
  187. 'desc' => '',
  188. 'update' => 'date',
  189. 'callback' => 'maketime',
  190. 'insert' => true,
  191. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  192. 'auth' => '"{pdate}" > 0',
  193. ),
  194. 'hr2' => array
  195. (
  196. 'name' => '积分配置',
  197. 'class' => '',//本项必须填写
  198. 'attr' => '',
  199. ),
  200. 'score_id' => array
  201. (
  202. 'type' => 'int-11',
  203. 'name' => '积分配置名称',
  204. 'default' => '',
  205. 'desc' => '积分配置名称',
  206. 'match' => 'is_numeric',
  207. 'update' => 'select',
  208. 'option' => $score,
  209. ),
  210. 'score_type' => array
  211. (
  212. 'type' => 'int-11',
  213. 'name' => '是否全局积分-全局积分就是与所有设置全局积分的合集共享一个积分,私有积分就是单独计算积分',
  214. 'default' => '1',
  215. 'desc' => '是否全局积分',
  216. 'match' => 'option',
  217. 'update' => 'radio',
  218. 'option' => $score_type,
  219. 'control' => 'score_type',
  220. ),
  221. 'score_name' => array
  222. (
  223. 'type' => 'varchar-180',
  224. 'name' => '积分自定义名称-仅私有积分可以设置,修改后,将替换积分配置名称,但具体积分规则无法替换',
  225. 'default' => '',
  226. 'desc' => '积分自定义名称',
  227. 'match' => 'option',
  228. 'update' => 'text',
  229. 'show' => 'score_type=2',
  230. ),
  231. 'hr3' => array
  232. (
  233. 'name' => '购买配置',
  234. 'class' => '',//本项必须填写
  235. 'attr' => '',
  236. ),
  237. 'ticket_name' => array
  238. (
  239. 'type' => 'varchar-50',
  240. 'name' => '门票名称-可以自定义门票的名称',
  241. 'default' => '门票',
  242. 'desc' => '门票名称',
  243. 'match' => 'option',
  244. 'update' => 'text',
  245. ),
  246. 'unit' => array
  247. (
  248. 'type' => 'varchar-80',
  249. 'name' => '门票单位-默认为张',
  250. 'default' => '张',
  251. 'desc' => '门票单位',
  252. 'match' => 'option',
  253. 'update' => 'text',
  254. //'list' => true,
  255. ),
  256. 'buy' => array
  257. (
  258. 'type' => 'int-11',
  259. 'name' => '是否收费',
  260. 'default' => '1',
  261. 'desc' => '是否收费',
  262. 'match' => 'option',
  263. 'update' => 'radio',
  264. 'option' => $buy,
  265. 'control' => 'buy',
  266. //'list' => true,
  267. 'search' => 'select',
  268. ),
  269. 'num_buy' => array
  270. (
  271. 'type' => 'int-11',
  272. 'name' => '购买数',
  273. 'default' => '0',
  274. 'desc' => '请填写购买数',
  275. 'match' => 'option',
  276. 'search' => 'order',
  277. //'show' => 'buy=1',
  278. 'list' => 'Dever::load("collection/lib/manage.num?id={id}")',
  279. 'list_name' => '统计数字',
  280. ),
  281. 'num_ratio_buy' => array
  282. (
  283. 'type' => 'varchar-20',
  284. 'name' => '购买系数-用以增加总购买量,系数不能小于等于0,支持两位小数,总购买量=(用户当前购买数+购买基数)*购买系数。',
  285. 'default' => '1',
  286. 'desc' => '手动增加购买系数',
  287. 'match' => 'is_string',
  288. 'update' => 'text',
  289. //'show' => 'buy=1',
  290. ),
  291. 'num_add_buy' => array
  292. (
  293. 'type' => 'int-11',
  294. 'name' => '购买基数',
  295. 'default' => '0',
  296. 'desc' => '手动增加阅读数',
  297. 'match' => 'option',
  298. 'update' => 'text',
  299. //'show' => 'buy=1',
  300. ),
  301. 'num_add_view' => array
  302. (
  303. 'type' => 'int-11',
  304. 'name' => '阅读数基数',
  305. 'default' => '0',
  306. 'desc' => '手动增加阅读数',
  307. 'match' => 'option',
  308. 'update' => 'text',
  309. //'show' => 'buy=2',
  310. ),
  311. 'num_view' => array
  312. (
  313. 'type' => 'int-11',
  314. 'name' => '阅读数',
  315. 'default' => '0',
  316. 'desc' => '请填写阅读数',
  317. 'match' => 'option',
  318. 'search' => 'order',
  319. ),
  320. 'buy_price' => array
  321. (
  322. 'type' => 'varchar-50',
  323. 'name' => '门票单张支付价格-单位元,直接填写数字即可',
  324. 'default' => '10',
  325. 'desc' => '支付价格',
  326. 'match' => 'is_string',
  327. 'update' => 'text',
  328. //'show' => 'buy=1',
  329. ),
  330. 'buy_content' => array
  331. (
  332. 'type' => 'text-255',
  333. 'name' => '购买说明-门票可以用{ticket_name}代替,将自动替换为设置的名称,{name}为合集名称',
  334. 'default' => "<p>
  335. 1、{ticket_name}购买成功后可直接进入{name};&nbsp;
  336. </p>
  337. <p>
  338. 2、{ticket_name}为虚拟商品,如无系统问题,购买后不可退款; &nbsp;
  339. </p>
  340. <p>
  341. 3、购买后可参与排行榜,榜上有名者可获得相应奖励,具体规则参考排行榜说明;&nbsp;
  342. </p>
  343. <p>
  344. 4、当购买成功后,系统会自动使用一个{ticket_name},多余可赠送好友;&nbsp;
  345. </p>
  346. <p>
  347. 5、好友使用你的{ticket_name}后,将成为你的永久伙伴,伙伴任何行为都会为你带来一定影响;
  348. </p>",
  349. 'desc' => '请输入内容',
  350. 'match' => 'is_string',
  351. 'update' => 'editor',
  352. 'key' => 1,
  353. //'show' => 'buy=1',
  354. ),
  355. 'audit' => array
  356. (
  357. 'type' => 'int-11',
  358. 'name' => '审核',
  359. 'default' => '1',
  360. 'desc' => '审核',
  361. 'match' => 'is_numeric',
  362. //'update' => 'select',
  363. 'option' => $audit,
  364. //'search' => 'select',
  365. //'list' => true,
  366. //'edit' => true,
  367. ),
  368. 'status' => array
  369. (
  370. 'type' => 'int-11',
  371. 'name' => '上线状态',
  372. 'default' => '2',
  373. 'desc' => '上线状态',
  374. 'match' => 'is_numeric',
  375. //'update' => 'select',
  376. 'option' => $status,
  377. 'search' => 'select',
  378. 'list' => true,
  379. 'edit' => true,
  380. ),
  381. 'hr4' => array
  382. (
  383. 'name' => '首页按钮配置',
  384. 'class' => '',//本项必须填写
  385. 'attr' => '',
  386. ),
  387. 'button' => array
  388. (
  389. 'type' => 'varchar-100',
  390. 'name' => '首页按钮名称配置-仅有两个按钮,用逗号隔开,第一个是入口,第二个是排行榜,这里仅能修改按钮名称',
  391. 'default' => '入口,排行榜',
  392. 'desc' => '首页按钮名称配置',
  393. 'match' => 'is_string',
  394. 'update' => 'text',
  395. ),
  396. 'button_ftcolor' => array
  397. (
  398. 'type' => 'varchar-10',
  399. 'name' => '首页按钮文字颜色-默认为白色',
  400. 'default' => '#ffffff',
  401. 'desc' => '首页按钮文字颜色',
  402. 'match' => 'is_string',
  403. 'update' => 'color',
  404. ),
  405. 'button_bgcolor' => array
  406. (
  407. 'type' => 'varchar-10',
  408. 'name' => '首页按钮背景颜色配置-默认为黑色',
  409. 'default' => '#000000',
  410. 'desc' => '首页按钮背景颜色配置',
  411. 'match' => 'is_string',
  412. 'update' => 'color',
  413. ),
  414. 'button_bgjcolor' => array
  415. (
  416. 'type' => 'varchar-10',
  417. 'name' => '首页按钮背景渐变颜色配置-默认为黑色',
  418. 'default' => '#000000',
  419. 'desc' => '首页按钮背景渐变颜色配置',
  420. 'match' => 'option',
  421. 'update' => 'color',
  422. ),
  423. 'hr5' => array
  424. (
  425. 'name' => '分享配置',
  426. 'class' => '',//本项必须填写
  427. 'attr' => '',
  428. ),
  429. 'share_title' => array
  430. (
  431. 'type' => 'varchar-100',
  432. 'name' => '分享标题-{name}为合集标题,{username}为当前合集用户名',
  433. 'default' => '{username}请你看{name}',
  434. 'desc' => '分享标题',
  435. 'match' => 'option',
  436. 'update' => 'text',
  437. ),
  438. 'share_pic' => array
  439. (
  440. 'type' => 'varchar-150',
  441. 'name' => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  442. 'default' => '',
  443. 'desc' => '分享图片',
  444. 'match' => 'option',
  445. 'update' => 'image',
  446. 'key' => '1',
  447. 'place' => '150',
  448. //'upload' => 'qiniu',
  449. //'large' => true,
  450. ),
  451. 'share_content' => array
  452. (
  453. 'type' => 'varchar-200',
  454. 'name' => '分享内容',
  455. 'default' => '',
  456. 'desc' => '分享内容',
  457. 'match' => 'option',
  458. 'update' => 'textarea',
  459. ),
  460. 'reorder' => array
  461. (
  462. 'type' => 'int-11',
  463. 'name' => '排序(数值越大越靠前)',
  464. 'default' => '1',
  465. 'desc' => '请输入排序',
  466. 'match' => 'option',
  467. //'update' => 'text',
  468. 'search' => 'order',
  469. 'list' => true,
  470. 'order' => 'desc',
  471. 'edit' => true,
  472. ),
  473. 'admin_founder' => array
  474. (
  475. 'type' => 'int-11',
  476. 'name' => '创建人',
  477. 'default' => '1',
  478. 'desc' => '创建人',
  479. 'match' => 'is_numeric',
  480. ),
  481. 'admin_editor' => array
  482. (
  483. 'type' => 'int-11',
  484. 'name' => '操作人',
  485. 'default' => '1',
  486. 'desc' => '操作人',
  487. 'match' => 'is_numeric',
  488. ),
  489. 'udate' => array
  490. (
  491. 'type' => 'int-11',
  492. 'name' => '更新时间',
  493. 'match' => array('is_numeric', time()),
  494. 'desc' => '',
  495. ),
  496. 'state' => array
  497. (
  498. 'type' => 'tinyint-1',
  499. 'name' => '状态',
  500. 'default' => '1',
  501. 'desc' => '请选择状态',
  502. 'match' => 'is_numeric',
  503. ),
  504. 'cdate' => array
  505. (
  506. 'type' => 'int-11',
  507. 'name' => '录入时间',
  508. 'match' => array('is_numeric', time()),
  509. 'desc' => '',
  510. # 只有insert时才生效
  511. 'insert' => true,
  512. ),
  513. ),
  514. 'top' => Dever::config('base')->top,
  515. # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
  516. 'top_option' => array
  517. (
  518. array
  519. (
  520. 'value' => $auth,
  521. 'col' => 'cate_id',
  522. ),
  523. array
  524. (
  525. 'value' => Dever::load('manage/auth.authData'),
  526. 'col' => 'id',
  527. ),
  528. ),
  529. # 更新表结构
  530. /*
  531. 'alter' => array
  532. (
  533. 2 => array
  534. (
  535. //array('update', 'role', 'role', 'varchar-100 1 角色'),
  536. array('add', 'unit', 'unit', 'varchar-80 张 单位'),
  537. ),
  538. 'version' => 2,
  539. ),
  540. */
  541. # 管理功能
  542. 'manage' => array
  543. (
  544. //'insert' => false,
  545. 'delete' => false,
  546. # 列表
  547. 'list_button' => array
  548. (
  549. 'update' => '编辑',
  550. 'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('collection/lib/manage.preview?type=1'))),
  551. 'br2' => array('<br />'),
  552. 'list1' => array('功能', '"function&search_option_info_id={id}&oper_table=info"' , '{audit} == 1'),
  553. 'list2' => array('门票', '"buy&search_option_info_id={id}&oper_table=info"' , '{audit} == 1'),
  554. 'list3' => array('项目', '"object&search_option_info_id={id}&oper_table=info"' , '{audit} == 1'),
  555. 'br3' => array('<br />'),
  556. 'list5' => array('章节', '"page&search_option_info_id={id}&oper_table=info"' , '{audit} == 1'),
  557. 'list6' => array('榜单', '"ranking&project=collection&search_option_info_id={id}&oper_table=info&oper_project=collection&where_id={id}"', '{audit} == 1'),
  558. ),
  559. ),
  560. # request 请求接口定义
  561. 'request' => array
  562. (
  563. 'search' => array
  564. (
  565. # 匹配的正则或函数 选填项
  566. 'option' => array
  567. (
  568. 'ids' => array('yes-id', 'in'),
  569. 'cate_id' => 'yes',
  570. 'name' => array('yes', 'like'),
  571. 'id' => 'yes',
  572. 'state' => 1,
  573. ),
  574. 'type' => 'all',
  575. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  576. 'limit' => '0,1000',
  577. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  578. ),
  579. 'getAll' => array
  580. (
  581. # 匹配的正则或函数 选填项
  582. 'option' => array
  583. (
  584. //'audit' => 2,
  585. 'buy' => 'yes',
  586. 'cate_id' => 'yes',
  587. 'status' => 1,
  588. 'state' => 1,
  589. ),
  590. 'type' => 'all',
  591. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  592. //'page' => array(10, 'list'),
  593. 'col' => $col,
  594. ),
  595. 'getAllByPage' => array
  596. (
  597. # 匹配的正则或函数 选填项
  598. 'option' => array
  599. (
  600. //'audit' => 2,
  601. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  602. 'time' => array('yes-pdate', '<=', 'or)'),
  603. 'buy' => 'yes',
  604. 'cate_id' => 'yes',
  605. 'status' => 1,
  606. 'state' => 1,
  607. ),
  608. 'type' => 'all',
  609. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  610. 'page' => array(10, 'list'),
  611. 'col' => $col,
  612. ),
  613. # 更新浏览量
  614. 'addView' => array
  615. (
  616. 'type' => 'update',
  617. 'where' => array
  618. (
  619. 'id' => 'yes',
  620. ),
  621. 'set' => array
  622. (
  623. 'num_view' => array('1', '+='),
  624. ),
  625. ),
  626. # 更新购买量
  627. 'addBuy' => array
  628. (
  629. 'type' => 'update',
  630. 'where' => array
  631. (
  632. 'id' => 'yes',
  633. ),
  634. 'set' => array
  635. (
  636. 'num_buy' => array('1', '+='),
  637. ),
  638. ),
  639. 'getIds' => array
  640. (
  641. # 匹配的正则或函数 选填项
  642. 'option' => array
  643. (
  644. 'cate_id' => array('yes-cate_id', 'in'),
  645. 'state' => 1,
  646. ),
  647. 'type' => 'all',
  648. 'order' => array('reorder' => 'desc', 'pdate' => 'desc','id' => 'desc'),
  649. 'col' => '*,id as value|id',
  650. ),
  651. 'getOne' => array
  652. (
  653. # 匹配的正则或函数 选填项
  654. 'option' => array
  655. (
  656. 'id' => 'yes',
  657. 'state' => 1,
  658. ),
  659. 'type' => 'one',
  660. 'col' => $col,
  661. ),
  662. # 热门
  663. 'getHot' => array
  664. (
  665. # 匹配的正则或函数 选填项
  666. 'option' => array
  667. (
  668. //'audit' => 2,
  669. 'hot' => 1,
  670. 'buy' => 'yes',
  671. 'time' => array('yes-pdate', '<=', 'or)'),
  672. 'cate_id' => 'yes',
  673. 'status' => 1,
  674. 'state' => 1,
  675. ),
  676. 'type' => 'all',
  677. 'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
  678. //'page' => array(10, 'list'),
  679. 'col' => $col,
  680. ),
  681. 'getNew' => array
  682. (
  683. # 匹配的正则或函数 选填项
  684. 'option' => array
  685. (
  686. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  687. 'time' => array('yes-pdate', '<=', 'or)'),
  688. 'cate_id' => 'yes',
  689. 'status' => 1,
  690. 'state' => 1,
  691. ),
  692. 'type' => 'one',
  693. 'order' => array('ssdate' => 'desc'),
  694. 'col' => $col . ',case when cate_id = 1 then pdate else pdate-'.$time.' end as ssdate',
  695. ),
  696. ),
  697. );
  698. /* 由top_option取代
  699. if ($auth) {
  700. $config['request']['list'] = array
  701. (
  702. 'type' => 'all',
  703. 'order' => array('id' => 'desc'),
  704. 'col' => '*|id',
  705. 'page' => array(15, 'list'),
  706. 'option' => array
  707. (
  708. 'cate_id' => array($auth, 'in'),
  709. ),
  710. );
  711. }
  712. */
  713. return $config;