outbox.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. );
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'outbox',
  22. # 显示给用户看的名称
  23. 'lang' => '发件箱',
  24. 'order' => 19,
  25. //'menu' => false,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'fulltext',
  37. 'order' => 'desc',
  38. 'list' => true,
  39. ),
  40. 'uid' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '发件人',
  44. 'default' => '-1',
  45. 'desc' => '请填写发件人',
  46. 'match' => 'is_numeric',
  47. //'update' => 'text',
  48. //'list' => true,
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-30',
  53. 'name' => '发件标题',
  54. 'default' => '',
  55. 'desc' => '请填写发件标题',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'list' => true,
  59. ),
  60. 'content' => array
  61. (
  62. 'type' => 'text-255',
  63. 'name' => '发件内容',
  64. 'default' => '',
  65. 'desc' => '请填写发件内容',
  66. 'match' => 'is_string',
  67. 'update' => 'textarea',
  68. 'list' => true,
  69. ),
  70. 'type' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '消息类型',
  74. 'default' => '1',
  75. 'desc' => '消息类型',
  76. 'match' => 'is_numeric',
  77. 'option' => $type,
  78. 'update' => 'select',
  79. //'search' => 'select',
  80. //'list' => true,
  81. ),
  82. 'state' => array
  83. (
  84. 'type' => 'tinyint-1',
  85. 'name' => '状态',
  86. 'default' => '1',
  87. 'desc' => '请选择状态',
  88. 'match' => 'is_numeric',
  89. 'option' => $option,
  90. 'update' => 'radio',
  91. 'search' => 'select',
  92. 'list' => true,
  93. ),
  94. 'cdate' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '录入时间',
  98. 'match' => array('is_numeric', time()),
  99. 'desc' => '',
  100. # 只有insert时才生效
  101. 'insert' => true,
  102. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  103. ),
  104. ),
  105. 'manage' => array
  106. (
  107. ),
  108. # request 请求接口定义
  109. 'request' => array
  110. (
  111. ),
  112. );