info.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  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' => '',
  446. 'desc' => '请输入内容',
  447. 'match' => 'is_string',
  448. 'update' => 'editor',
  449. 'key' => 1,
  450. 'show' => 'buy=1',
  451. ),
  452. 'score' => array
  453. (
  454. 'type' => 'varchar-80',
  455. 'name' => '购买增加积分数-直接填写购买单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  456. 'default' => '20',
  457. 'desc' => '增加积分数',
  458. 'match' => 'is_string',
  459. 'update' => 'text',
  460. 'show' => 'buy=1',
  461. ),
  462. 'dh_score' => array
  463. (
  464. 'type' => 'varchar-80',
  465. 'name' => '兑换增加积分数-直接填写兑换单本小刊的积分数,设置之后,积分规则里的设置将失效,如果设置为0,则按照积分规则进行增加积分',
  466. 'default' => '20',
  467. 'desc' => '增加积分数',
  468. 'match' => 'is_string',
  469. 'update' => 'text',
  470. 'show' => 'buy=1',
  471. ),
  472. 'share_yes' => array
  473. (
  474. 'type' => 'int-11',
  475. 'name' => '是否显示分享按钮',
  476. 'default' => '1',
  477. 'desc' => '是否显示分享按钮',
  478. 'match' => 'option',
  479. 'update' => 'radio',
  480. 'option' => $share,
  481. 'control' => 'share_yes',
  482. ),
  483. 'share_title' => array
  484. (
  485. 'type' => 'varchar-100',
  486. 'name' => '分享标题',
  487. 'default' => '',
  488. 'desc' => '分享标题',
  489. 'match' => 'option',
  490. 'update' => 'text',
  491. 'show' => 'share_yes=1',
  492. ),
  493. 'share_pic' => array
  494. (
  495. 'type' => 'varchar-150',
  496. 'name' => '分享图片-图片尺寸570*570px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  497. 'default' => '',
  498. 'desc' => '分享图片',
  499. 'match' => 'is_string',
  500. 'update' => 'image',
  501. 'key' => '1',
  502. 'place' => '150',
  503. 'show' => 'share_yes=1',
  504. //'upload' => 'qiniu',
  505. //'large' => true,
  506. ),
  507. 'share_content' => array
  508. (
  509. 'type' => 'varchar-200',
  510. 'name' => '分享内容',
  511. 'default' => '',
  512. 'desc' => '分享内容',
  513. 'match' => 'option',
  514. 'update' => 'textarea',
  515. 'show' => 'share_yes=1',
  516. ),
  517. 'reorder' => array
  518. (
  519. 'type' => 'int-11',
  520. 'name' => '排序(数值越大越靠前)',
  521. 'default' => '1',
  522. 'desc' => '请输入排序',
  523. 'match' => 'option',
  524. 'update' => 'text',
  525. 'search' => 'order',
  526. 'list' => true,
  527. 'order' => 'desc',
  528. 'edit' => true,
  529. ),
  530. 'udate' => array
  531. (
  532. 'type' => 'int-11',
  533. 'name' => '更新时间',
  534. 'match' => array('is_numeric', time()),
  535. 'desc' => '',
  536. ),
  537. 'cdate' => array
  538. (
  539. 'type' => 'int-11',
  540. 'name' => '录入时间',
  541. 'match' => array('is_numeric', time()),
  542. 'desc' => '',
  543. # 只有insert时才生效
  544. 'insert' => true,
  545. ),
  546. ),
  547. 'top' => Dever::config('base')->top,
  548. # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
  549. 'top_option' => array
  550. (
  551. array
  552. (
  553. 'value' => $auth,
  554. 'col' => 'cate_id',
  555. ),
  556. array
  557. (
  558. 'value' => Dever::load('manage/auth.authData'),
  559. 'col' => 'id',
  560. ),
  561. ),
  562. # 管理功能
  563. 'manage' => array
  564. (
  565. //'insert' => false,
  566. 'delete' => false,
  567. # 列表
  568. 'list_button' => array
  569. (
  570. /*
  571. 'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
  572. 'edit1' => array('活动预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=13')), '{audit} == 1 && {buy} == 1'),
  573. 'br2' => array('<br />'),
  574. 'list10' => array('排行榜', '"journal_num&project=act&search_type=4&search_option_journal_id={id}&oper_parent=info&oper_project=journal"' , '{audit} == 1 && {buy} == 1'),
  575. 'list11' => array('积分排行榜(旧)', '"score&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"', '{audit} == 1 && {buy} == 1'),
  576. //'list11' => array('邀请排行', '"invite&project=act&search_type=4&search_option_data_id={id}&oper_parent=info&oper_project=journal"'),
  577. 'br1' => array('<br />'),
  578. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  579. 'br2' => array('<br />'),
  580. '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'),
  581. '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'),
  582. 'br3' => array('<br />'),
  583. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
  584. 'list2' => array('购买明星设置', '"star&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1 && {buy_type} == 2'),
  585. */
  586. 'update' => '编辑电子刊',
  587. 'br1' => array('<br />'),
  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. 'list' => array('内页管理', '"content&search_option_info_id={id}&oper_parent=info&page_type=1"' , '{audit} == 1'),
  593. //'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'),
  594. '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'),
  595. 'list1' => array('购买本数管理', '"buy_num&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1'),
  596. 'list2' => array('购买明星设置', '"star&search_option_info_id={id}&oper_parent=info"' , '{audit} == 1 && {buy} == 1 && {buy_type} == 2'),
  597. ),
  598. ),
  599. # request 请求接口定义
  600. 'request' => array
  601. (
  602. 'search' => array
  603. (
  604. # 匹配的正则或函数 选填项
  605. 'option' => array
  606. (
  607. 'ids' => array('yes-id', 'in'),
  608. 'cate_id' => 'yes',
  609. 'name' => array('yes', 'like'),
  610. 'id' => 'yes',
  611. 'state' => 1,
  612. ),
  613. 'type' => 'all',
  614. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  615. 'limit' => '0,1000',
  616. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  617. ),
  618. 'getAll' => array
  619. (
  620. # 匹配的正则或函数 选填项
  621. 'option' => array
  622. (
  623. //'audit' => 2,
  624. 'buy' => 'yes',
  625. 'cate_id' => 'yes',
  626. 'publish' => array('yes', 'like'),
  627. 'status' => 2,
  628. 'state' => 1,
  629. ),
  630. 'type' => 'all',
  631. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  632. //'page' => array(10, 'list'),
  633. 'col' => $col,
  634. ),
  635. 'getAllByPage' => array
  636. (
  637. # 匹配的正则或函数 选填项
  638. 'option' => array
  639. (
  640. //'audit' => 2,
  641. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  642. 'time' => array('yes-pdate', '<=', 'or)'),
  643. 'publish' => array('yes', 'like'),
  644. 'buy' => 'yes',
  645. 'cate_id' => 'yes',
  646. 'status' => 2,
  647. 'state' => 1,
  648. ),
  649. 'type' => 'all',
  650. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  651. 'page' => array(10, 'list'),
  652. 'col' => $col,
  653. ),
  654. # 更新浏览量
  655. 'addView' => array
  656. (
  657. 'type' => 'update',
  658. 'where' => array
  659. (
  660. 'id' => 'yes',
  661. ),
  662. 'set' => array
  663. (
  664. 'num_view' => array('1', '+='),
  665. ),
  666. ),
  667. # 更新订阅量
  668. 'addDing' => array
  669. (
  670. 'type' => 'update',
  671. 'where' => array
  672. (
  673. 'id' => 'yes',
  674. ),
  675. 'set' => array
  676. (
  677. 'num_up' => array('1', '+='),
  678. ),
  679. ),
  680. 'getIds' => array
  681. (
  682. # 匹配的正则或函数 选填项
  683. 'option' => array
  684. (
  685. 'cate_id' => array('yes-cate_id', 'in'),
  686. 'state' => 1,
  687. ),
  688. 'type' => 'all',
  689. 'order' => array('reorder' => 'desc','id' => 'desc'),
  690. 'col' => '*,id as value|id',
  691. ),
  692. 'getOne' => array
  693. (
  694. # 匹配的正则或函数 选填项
  695. 'option' => array
  696. (
  697. 'id' => 'yes',
  698. 'publish' => array('yes', 'like'),
  699. 'state' => 1,
  700. ),
  701. 'type' => 'one',
  702. 'col' => $col,
  703. ),
  704. 'getNew' => array
  705. (
  706. # 匹配的正则或函数 选填项
  707. 'option' => array
  708. (
  709. 'cate_id_1' => array('yes-cate_id', '=', 'and('),
  710. 'time' => array('yes-pdate', '<=', 'or)'),
  711. 'cate_id' => 'yes',
  712. 'publish' => array('yes', 'like'),
  713. 'status' => 2,
  714. 'state' => 1,
  715. ),
  716. 'type' => 'one',
  717. 'order' => array('ssdate' => 'desc'),
  718. 'col' => $col . ',case when cate_id = 1 then pdate else pdate-'.$time.' end as ssdate',
  719. ),
  720. ),
  721. );
  722. /* 由top_option取代
  723. if ($auth) {
  724. $config['request']['list'] = array
  725. (
  726. 'type' => 'all',
  727. 'order' => array('id' => 'desc'),
  728. 'col' => '*|id',
  729. 'page' => array(15, 'list'),
  730. 'option' => array
  731. (
  732. 'cate_id' => array($auth, 'in'),
  733. ),
  734. );
  735. }
  736. */
  737. return $config;