outbox.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. 'project_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '所属项目',
  81. 'default' => '1',
  82. 'desc' => '所属项目',
  83. 'match' => 'is_numeric',
  84. 'option' => $project,
  85. 'update' => 'select',
  86. //'search' => 'select',
  87. 'list' => true,
  88. ),
  89. 'type' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '消息类型',
  93. 'default' => '1',
  94. 'desc' => '消息类型',
  95. 'match' => 'is_numeric',
  96. 'option' => $type,
  97. 'update' => 'select',
  98. //'search' => 'select',
  99. 'list' => true,
  100. ),
  101. 'scope' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '消息范围',
  105. 'default' => '1',
  106. 'desc' => '消息范围',
  107. 'match' => 'is_numeric',
  108. 'option' => $scope,
  109. 'update' => 'radio',
  110. 'search' => 'select',
  111. 'list' => true,
  112. 'control' => 'scope',
  113. ),
  114. 'to_uid' => array
  115. (
  116. 'type' => 'text-255',
  117. 'name' => '收件人-直接填写uid,多个用换行隔开,后期升级',
  118. 'default' => '',
  119. 'desc' => '请填写收件人',
  120. 'match' => 'is_numeric',
  121. 'update' => 'textarea',
  122. 'show' => 'scope=1',
  123. ),
  124. 'state' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '状态',
  128. 'default' => '1',
  129. 'desc' => '请选择状态',
  130. 'match' => 'is_numeric',
  131. ),
  132. 'cdate' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '录入时间',
  136. 'match' => array('is_numeric', time()),
  137. 'desc' => '',
  138. # 只有insert时才生效
  139. 'insert' => true,
  140. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  141. ),
  142. ),
  143. 'manage' => array
  144. (
  145. ),
  146. # request 请求接口定义
  147. 'request' => array
  148. (
  149. ),
  150. );