outbox.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. # 定义几个常用的选项
  3. $option = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. /*
  9. $type = function()
  10. {
  11. return Dever::load('message/type-all');
  12. };
  13. */
  14. $type = array
  15. (
  16. //1 => '系统消息',
  17. 2 => '系统通知',
  18. );
  19. $project = function()
  20. {
  21. return Dever::load('message/project-state');
  22. };
  23. return array
  24. (
  25. # 表名
  26. 'name' => 'outbox',
  27. # 显示给用户看的名称
  28. 'lang' => '发件箱',
  29. 'order' => 19,
  30. //'menu' => false,
  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. 'state' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '状态',
  105. 'default' => '1',
  106. 'desc' => '请选择状态',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'cdate' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '录入时间',
  113. 'match' => array('is_numeric', time()),
  114. 'desc' => '',
  115. # 只有insert时才生效
  116. 'insert' => true,
  117. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  118. ),
  119. ),
  120. 'manage' => array
  121. (
  122. ),
  123. # request 请求接口定义
  124. 'request' => array
  125. (
  126. ),
  127. );