outbox.php 2.1 KB

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