moment.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <?php
  2. $audit = Dever::config('base')->audit;
  3. $table = Dever::config('base')->table;
  4. $table_name = Dever::config('base')->table_name;
  5. return array
  6. (
  7. # 表名
  8. 'name' => 'moment',
  9. # 显示给用户看的名称
  10. 'lang' => '朋友圈管理',
  11. # 是否显示在后台菜单
  12. 'order' => 79,
  13. 'set' => array
  14. (
  15. 'table' => $table,
  16. 'table_name' => $table_name,
  17. ),
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'order' => 'desc',
  29. //'list' => true,
  30. ),
  31. 'uid' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '用户名',
  35. 'default' => '0',
  36. 'desc' => '请选择用户',
  37. 'match' => 'is_numeric',
  38. //'update' => 'text',
  39. //'search' => 'select',
  40. 'search' => array
  41. (
  42. 'api' => 'passport/user-all',
  43. 'col' => 'username',
  44. 'result' => 'id',
  45. ),
  46. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  47. ),
  48. 'to_id' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '引用的信息id',
  52. 'default' => '0',
  53. 'desc' => '引用的信息id',
  54. 'match' => 'is_numeric',
  55. //'update' => 'text',
  56. ),
  57. 'to_uid' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '引用的信息所属uid',
  61. 'default' => '0',
  62. 'desc' => '引用的信息所属uid',
  63. 'match' => 'is_numeric',
  64. //'update' => 'text',
  65. ),
  66. 'type' => array
  67. (
  68. 'type' => 'tinyint-1',
  69. 'name' => '所属数据源',
  70. 'default' => '',
  71. 'desc' => '所属数据源',
  72. 'match' => 'option',
  73. 'option' => $table,
  74. 'search' => 'select',
  75. //'update' => 'select',
  76. //'list' => true,
  77. ),
  78. 'type_id' => array
  79. (
  80. 'type' => 'varchar-11',
  81. 'name' => '数据源id',
  82. 'default' => '',
  83. 'desc' => '数据源id',
  84. 'match' => 'option',
  85. //'update' => 'text',
  86. ),
  87. 'type_name' => array
  88. (
  89. 'type' => 'varchar-200',
  90. 'name' => '数据源标题',
  91. 'default' => '',
  92. 'desc' => '数据源标题',
  93. 'match' => 'option',
  94. 'search' => 'fulltext',
  95. //'update' => 'text',
  96. //'list' => true,
  97. ),
  98. 'day' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '日期',
  102. 'default' => '-1',
  103. 'desc' => '日期',
  104. 'match' => 'is_numeric',
  105. //'update' => 'text',
  106. ),
  107. 'num_up' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '点赞数',
  111. 'default' => '0',
  112. 'desc' => '点赞数',
  113. 'match' => 'option',
  114. //'search' => 'order',
  115. //'list' => true,
  116. ),
  117. 'num_oppose' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '反对数',
  121. 'default' => '0',
  122. 'desc' => '反对数',
  123. 'match' => 'option',
  124. //'search' => 'order',
  125. //'list' => true,
  126. ),
  127. 'num_comment' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '评论数',
  131. 'default' => '0',
  132. 'desc' => '评论数',
  133. 'match' => 'option',
  134. //'search' => 'order',
  135. //'list' => true,
  136. ),
  137. 'pic' => array
  138. (
  139. 'type' => 'text-255',
  140. 'name' => '图片-图片尺寸不等,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  141. 'default' => '',
  142. 'desc' => '图片',
  143. 'match' => 'is_string',
  144. 'update' => 'images',
  145. 'key' => '1',
  146. ),
  147. 'content' => array
  148. (
  149. 'type' => 'text-255',
  150. 'name' => '内容',
  151. 'update' => 'editor',
  152. 'key' => 1,
  153. 'default' => '',
  154. 'desc' => '请输入内容',
  155. 'match' => 'is_string',
  156. 'search' => 'fulltext',
  157. //'list' => true,
  158. //'modal' => '查看详情',
  159. 'list' => 'Dever::load("community/lib/info.content", "{id}")',
  160. ),
  161. 'audit' => array
  162. (
  163. 'type' => 'int-11',
  164. 'name' => '审核',
  165. 'default' => '1',
  166. 'desc' => '审核',
  167. 'match' => 'is_numeric',
  168. //'update' => 'select',
  169. 'option' => $audit,
  170. //'search' => 'select',
  171. 'list' => true,
  172. 'edit' => true,
  173. ),
  174. 'state' => array
  175. (
  176. 'type' => 'tinyint-1',
  177. 'name' => '状态',
  178. 'default' => '1',
  179. 'desc' => '请选择状态',
  180. 'match' => 'is_numeric',
  181. ),
  182. 'cdate' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '时间',
  186. 'match' => array('is_numeric', time()),
  187. 'desc' => '',
  188. # 只有insert时才生效
  189. 'insert' => true,
  190. 'search' => 'date',
  191. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  192. ),
  193. ),
  194. # 索引
  195. 'index' => array
  196. (
  197. # 索引名 => 索引id
  198. //'id' => 'id,state',
  199. 1 => array
  200. (
  201. 'search' => 'type,type_id,day',
  202. ),
  203. 'version' => 1,
  204. ),
  205. 'manage' => array
  206. (
  207. //'insert' => false,
  208. //'edit' => false,
  209. ),
  210. # request 请求接口定义
  211. 'request' => array
  212. (
  213. 'getAll' => array
  214. (
  215. # 匹配的正则或函数 选填项
  216. 'option' => array
  217. (
  218. 'uid' => 'yes',
  219. 'type' => 'yes',
  220. 'type_id' => 'yes',
  221. 'day' => 'yes',
  222. 'noid' => array('yes-id', '!='),
  223. 'audit' => 1,
  224. 'state' => 1,
  225. ),
  226. 'type' => 'all',
  227. 'order' => array('num_up`-`num_oppose' => 'desc', 'id' => 'desc'),
  228. 'page' => array(5, 'list'),
  229. 'col' => '*',
  230. ),
  231. 'getHot' => array
  232. (
  233. # 匹配的正则或函数 选填项
  234. 'option' => array
  235. (
  236. 'uid' => 'yes',
  237. 'type' => 'yes',
  238. 'type_id' => 'yes',
  239. 'day' => 'yes',
  240. 'audit' => 1,
  241. 'state' => 1,
  242. ),
  243. 'type' => 'all',
  244. 'order' => array('num_up`-`num_oppose' => 'desc', 'id' => 'desc'),
  245. 'limit' => '0,1',
  246. 'col' => '*',
  247. ),
  248. 'getTotal' => array
  249. (
  250. # 匹配的正则或函数 选填项
  251. 'option' => array
  252. (
  253. 'uid' => 'yes',
  254. 'type' => 'yes',
  255. 'type_id' => 'yes',
  256. 'day' => 'yes',
  257. 'audit' => 1,
  258. 'state' => 1,
  259. ),
  260. 'type' => 'count',
  261. ),
  262. )
  263. );