info.php 28 KB

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