outbox.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. $message_type = Dever::db('message/type');
  9. $type = function() use($message_type)
  10. {
  11. return $message_type->state();
  12. };
  13. $scope = $message_type->config['config_scope'];
  14. $project = function()
  15. {
  16. return Dever::load('message/project-state');
  17. };
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'outbox',
  22. # 显示给用户看的名称
  23. 'lang' => '发件箱',
  24. 'order' => 19,
  25. //'menu' => false,
  26. 'end' => array
  27. (
  28. 'update' => 'message/lib/manage.send',
  29. 'insert' => 'message/lib/manage.send',
  30. ),
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'search' => 'fulltext',
  42. 'order' => 'desc',
  43. 'list' => true,
  44. ),
  45. 'uid' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '发件人',
  49. 'default' => '-1',
  50. 'desc' => '请填写发件人',
  51. 'match' => 'is_numeric',
  52. //'update' => 'text',
  53. 'list' => '{uid} > 0 ? {uid} : "系统"',
  54. ),
  55. 'name' => array
  56. (
  57. 'type' => 'varchar-30',
  58. 'name' => '发件标题',
  59. 'default' => '',
  60. 'desc' => '请填写发件标题',
  61. 'match' => 'is_string',
  62. 'search' => 'fulltext',
  63. 'update' => 'text',
  64. 'list' => true,
  65. ),
  66. 'content' => array
  67. (
  68. 'type' => 'text-255',
  69. 'name' => '发件内容',
  70. 'default' => '',
  71. 'desc' => '请填写发件内容',
  72. 'match' => 'is_string',
  73. 'search' => 'fulltext',
  74. 'update' => 'textarea',
  75. 'list' => true,
  76. ),
  77. 'link' => array
  78. (
  79. 'type' => 'varchar-30',
  80. 'name' => '链接-选填,如有链接,则点击消息跳转至该链接',
  81. 'default' => '',
  82. 'desc' => '链接',
  83. 'match' => 'option',
  84. 'search' => 'fulltext',
  85. 'update' => 'text',
  86. ),
  87. 'project_id' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '所属项目',
  91. 'default' => '1',
  92. 'desc' => '所属项目',
  93. 'match' => 'is_numeric',
  94. 'option' => $project,
  95. 'update' => 'select',
  96. //'search' => 'select',
  97. 'list' => true,
  98. ),
  99. 'type' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '消息类型',
  103. 'default' => '1',
  104. 'desc' => '消息类型',
  105. 'match' => 'is_numeric',
  106. 'option' => $type,
  107. 'update' => 'select',
  108. //'search' => 'select',
  109. 'list' => true,
  110. ),
  111. 'scope' => array
  112. (
  113. 'type' => 'tinyint-1',
  114. 'name' => '消息范围',
  115. 'default' => '2',
  116. 'desc' => '消息范围',
  117. 'match' => 'is_numeric',
  118. 'option' => $scope,
  119. 'update' => 'radio',
  120. 'search' => 'select',
  121. 'list' => true,
  122. 'control' => 'scope',
  123. ),
  124. 'param' => array
  125. (
  126. 'type' => 'varchar-800',
  127. 'name' => '传入参数-一般为json格式数据',
  128. 'default' => '',
  129. 'desc' => '传入参数',
  130. 'match' => 'is_string',
  131. ),
  132. 'to_uid' => array
  133. (
  134. 'type' => 'text-255',
  135. 'name' => '收件人-直接填写uid,多个用换行隔开,后期升级',
  136. 'default' => '',
  137. 'desc' => '请填写收件人',
  138. 'match' => 'is_numeric',
  139. 'update' => 'textarea',
  140. 'show' => 'scope=1',
  141. ),
  142. 'state' => array
  143. (
  144. 'type' => 'tinyint-1',
  145. 'name' => '状态',
  146. 'default' => '1',
  147. 'desc' => '请选择状态',
  148. 'match' => 'is_numeric',
  149. ),
  150. 'cdate' => array
  151. (
  152. 'type' => 'int-11',
  153. 'name' => '录入时间',
  154. 'match' => array('is_numeric', time()),
  155. 'desc' => '',
  156. # 只有insert时才生效
  157. 'insert' => true,
  158. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  159. ),
  160. ),
  161. 'manage' => array
  162. (
  163. ),
  164. # request 请求接口定义
  165. 'request' => array
  166. (
  167. ),
  168. );