collection.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'collection',
  6. # 显示给用户看的名称
  7. 'lang' => '用户拥有合集记录',
  8. 'menu' => false,
  9. # 数据结构
  10. 'struct' => array
  11. (
  12. 'id' => array
  13. (
  14. 'type' => 'int-11',
  15. 'name' => 'ID',
  16. 'default' => '',
  17. 'desc' => '',
  18. 'match' => 'is_numeric',
  19. 'search' => 'order',
  20. 'update' => 'hidden',
  21. //'list' => true,
  22. ),
  23. 'uid' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => '用户名',
  27. 'default' => '0',
  28. 'desc' => '请选择用户',
  29. 'match' => 'is_numeric',
  30. 'update' => 'text',
  31. //'search' => 'select',
  32. 'search' => array
  33. (
  34. 'api' => 'passport/user-all',
  35. 'col' => 'username',
  36. 'result' => 'id',
  37. ),
  38. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  39. ),
  40. 'source_uid' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '来源',
  44. 'default' => '0',
  45. 'desc' => '请选择用户',
  46. 'match' => 'is_numeric',
  47. 'update' => 'text',
  48. //'search' => 'select',
  49. 'search' => array
  50. (
  51. 'api' => 'passport/user-all',
  52. 'col' => 'username',
  53. 'result' => 'id',
  54. ),
  55. 'list' => '{source_uid} > 0 ? Dever::load("passport/user-one#username", {source_uid}) : "无"',
  56. ),
  57. 'cate_id' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '合集分类',
  61. 'default' => '',
  62. 'desc' => '合集分类',
  63. 'match' => 'is_numeric',
  64. 'update' => 'text',
  65. ),
  66. 'info_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '合集',
  70. 'default' => '',
  71. 'desc' => '合集',
  72. 'match' => 'is_numeric',
  73. 'update' => 'text',
  74. ),
  75. 'ticket_id' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '门票id',
  79. 'default' => '',
  80. 'desc' => '门票id',
  81. 'match' => 'is_numeric',
  82. 'update' => 'text',
  83. ),
  84. 'num' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '数量',
  88. 'default' => '0',
  89. 'desc' => '数量',
  90. 'match' => 'is_numeric',
  91. 'update' => 'text',
  92. ),
  93. 'state' => array
  94. (
  95. 'type' => 'tinyint-1',
  96. 'name' => '状态',
  97. 'default' => '1',
  98. 'desc' => '请选择状态',
  99. 'match' => 'is_numeric',
  100. ),
  101. 'cdate' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '操作时间',
  105. 'match' => array('is_numeric', time()),
  106. 'desc' => '',
  107. # 只有insert时才生效
  108. //'insert' => true,
  109. 'search' => 'date',
  110. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  111. ),
  112. ),
  113. 'manage' => array
  114. (
  115. ),
  116. 'request' => array
  117. (
  118. 'getAll' => array
  119. (
  120. # 匹配的正则或函数 选填项
  121. 'option' => array
  122. (
  123. 'uid' => 'yes',
  124. 'info_id' => 'yes',
  125. 'cate_id' => 'yes',
  126. 'state' => 1,
  127. ),
  128. # 联表
  129. 'join' => array
  130. (
  131. array
  132. (
  133. 'table' => 'collection/info',
  134. 'type' => 'left join',
  135. 'on' => array('info_id','id'),
  136. 'col' => 't_2.id,t_2.name,t_2.desc,t_2.pic_cover',
  137. ),
  138. ),
  139. 'type' => 'all',
  140. 'order' => array('t_2.reorder' => 'desc', 't_2.pdate' => 'desc', 't_2.id' => 'desc'),
  141. 'page' => array(10, 'list'),
  142. 'col' => 'info_id,num',
  143. ),
  144. 'getCateAll' => array
  145. (
  146. # 匹配的正则或函数 选填项
  147. 'option' => array
  148. (
  149. 'uid' => 'yes',
  150. 'cate_id' => 'yes',
  151. 'state' => 1,
  152. ),
  153. 'type' => 'all',
  154. 'order' => array('id' => 'desc'),
  155. 'group' => 'cate_id',
  156. 'col' => 'info_id,cate_id,num|cate_id',
  157. ),
  158. 'num' => array
  159. (
  160. # 匹配的正则或函数 选填项
  161. 'option' => array
  162. (
  163. 'uid' => 'yes',
  164. 'info_id' => 'yes',
  165. 'state' => 1,
  166. ),
  167. 'type' => 'one',
  168. 'col' => 'sum(num) as num',
  169. ),
  170. ),
  171. );