type.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. $scope = array
  3. (
  4. 1 => '单一用户',
  5. 2 => '所有用户',
  6. );
  7. $type = array
  8. (
  9. 1 => '不发送',
  10. 2 => '发送',
  11. );
  12. $push = function()
  13. {
  14. return Dever::db('message/push')->state();
  15. };
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'type',
  20. # 显示给用户看的名称
  21. 'lang' => '消息类型',
  22. 'order' => 20,
  23. 'config_scope' => $scope,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'fulltext',
  35. 'order' => 'desc',
  36. 'list' => true,
  37. ),
  38. 'name' => array
  39. (
  40. 'type' => 'varchar-30',
  41. 'name' => '类型名称-类型id值为10以下则为系统消息',
  42. 'default' => '',
  43. 'desc' => '请填写类型名称',
  44. 'match' => 'is_string',
  45. 'update' => 'text',
  46. 'list' => true,
  47. ),
  48. 'scope' => array
  49. (
  50. 'type' => 'tinyint-1',
  51. 'name' => '消息范围',
  52. 'default' => '1',
  53. 'desc' => '消息范围',
  54. 'match' => 'is_numeric',
  55. 'option' => $scope,
  56. 'update' => 'radio',
  57. 'search' => 'select',
  58. 'list' => true,
  59. ),
  60. 'type' => array
  61. (
  62. 'type' => 'tinyint-1',
  63. 'name' => '同步推送',
  64. 'default' => '1',
  65. 'desc' => '同步推送',
  66. 'match' => 'is_numeric',
  67. 'option' => $type,
  68. 'update' => 'radio',
  69. //'search' => 'select',
  70. 'list' => true,
  71. 'control' => 'type',
  72. ),
  73. 'push' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '推送方式',
  77. 'default' => '1',
  78. 'desc' => '推送方式',
  79. 'match' => 'is_numeric',
  80. 'option' => $push,
  81. 'update' => 'select',
  82. 'show' => 'type=2',
  83. ),
  84. 'state' => array
  85. (
  86. 'type' => 'tinyint-1',
  87. 'name' => '状态',
  88. 'default' => '1',
  89. 'desc' => '请选择状态',
  90. 'match' => 'is_numeric',
  91. ),
  92. 'cdate' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '录入时间',
  96. 'match' => array('is_numeric', time()),
  97. 'desc' => '',
  98. # 只有insert时才生效
  99. 'insert' => true,
  100. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  101. ),
  102. ),
  103. 'manage' => array
  104. (
  105. ),
  106. 'default' => array
  107. (
  108. 'col' => 'id,name,type,scope,state,cdate',
  109. 'value' => array
  110. (
  111. '1, "系统消息",1, 1, 1,' . DEVER_TIME,
  112. ),
  113. ),
  114. # request 请求接口定义
  115. 'request' => array
  116. (
  117. ),
  118. );