chat_info.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'chat_info',
  6. # 显示给用户看的名称
  7. 'lang' => '聊天信息',
  8. # 是否显示在后台菜单
  9. 'order' => 20,
  10. 'menu' => false,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. 'order' => 'desc',
  22. //'list' => true,
  23. ),
  24. 'uid' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户名',
  28. 'default' => '0',
  29. 'desc' => '请选择用户',
  30. 'match' => 'is_numeric',
  31. 'update' => 'text',
  32. //'search' => 'select',
  33. 'search' => array
  34. (
  35. 'api' => 'passport/user-all',
  36. 'col' => 'username',
  37. 'result' => 'id',
  38. ),
  39. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  40. ),
  41. 'to_uid' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => '聊天对象uid',
  45. 'default' => '0',
  46. 'desc' => '聊天对象uid',
  47. 'match' => 'is_numeric',
  48. //'update' => 'text',
  49. ),
  50. 'key' => array
  51. (
  52. 'type' => 'varchar-100',
  53. 'name' => '聊天key',
  54. 'default' => '',
  55. 'desc' => '聊天key',
  56. 'match' => 'is_numeric',
  57. //'update' => 'text',
  58. ),
  59. 'info_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '数据源id',
  63. 'default' => '',
  64. 'desc' => '数据源id',
  65. 'match' => 'option',
  66. 'update' => 'text',
  67. ),
  68. 'collection_id' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '合集id',
  72. 'default' => '',
  73. 'desc' => '合集id',
  74. 'match' => 'option',
  75. 'update' => 'text',
  76. ),
  77. 'text' => array
  78. (
  79. 'type' => 'text-255',
  80. 'name' => '文本内容',
  81. 'update' => 'editor',
  82. 'default' => '',
  83. 'desc' => '请输入文本内容',
  84. 'match' => 'is_string',
  85. ),
  86. 'pic' => array
  87. (
  88. 'type' => 'varchar-2000',
  89. 'name' => '图片-图片尺寸不等,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  90. 'default' => '',
  91. 'desc' => '图片',
  92. 'match' => 'is_string',
  93. 'update' => 'images',
  94. 'key' => '1',
  95. ),
  96. 'day' => array
  97. (
  98. 'type' => 'int-11',
  99. 'name' => '日期',
  100. 'default' => '-1',
  101. 'desc' => '日期',
  102. 'match' => 'is_numeric',
  103. //'update' => 'text',
  104. ),
  105. 'state' => array
  106. (
  107. 'type' => 'tinyint-1',
  108. 'name' => '状态',
  109. 'default' => '1',
  110. 'desc' => '请选择状态',
  111. 'match' => 'is_numeric',
  112. ),
  113. 'cdate' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '喜欢时间',
  117. 'match' => array('is_numeric', time()),
  118. 'desc' => '',
  119. # 只有insert时才生效
  120. 'insert' => true,
  121. 'search' => 'date',
  122. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  123. ),
  124. ),
  125. 'manage' => array
  126. (
  127. 'insert' => false,
  128. 'edit' => false,
  129. 'delete' => false,
  130. ),
  131. # request 请求接口定义
  132. 'request' => array
  133. (
  134. 'getAll' => array
  135. (
  136. # 匹配的正则或函数 选填项
  137. 'option' => array
  138. (
  139. 'key' => 'yes',
  140. 'uid' => 'yes',
  141. 'to_uid' => 'yes',
  142. 'collection_id' => 'yes',
  143. 'state' => 1,
  144. ),
  145. 'type' => 'all',
  146. 'order' => array('id' => 'desc'),
  147. 'page' => array(15, 'list'),
  148. 'col' => '*',
  149. ),
  150. 'getNew' => array
  151. (
  152. # 匹配的正则或函数 选填项
  153. 'option' => array
  154. (
  155. 'key' => 'yes',
  156. 'uid' => 'yes',
  157. 'to_uid' => 'yes',
  158. 'collection_id' => 'yes',
  159. 'state' => 1,
  160. ),
  161. 'type' => 'one',
  162. 'order' => array('id' => 'desc'),
  163. 'col' => '*',
  164. ),
  165. )
  166. );