type.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. 'menu' => false,
  25. # 数据结构
  26. 'struct' => array
  27. (
  28. 'id' => array
  29. (
  30. 'type' => 'int-11',
  31. 'name' => 'ID',
  32. 'default' => '',
  33. 'desc' => '',
  34. 'match' => 'is_numeric',
  35. 'search' => 'fulltext',
  36. 'order' => 'desc',
  37. 'list' => true,
  38. ),
  39. 'name' => array
  40. (
  41. 'type' => 'varchar-30',
  42. 'name' => '类型名称',
  43. 'default' => '',
  44. 'desc' => '请填写类型名称',
  45. 'match' => 'is_string',
  46. 'update' => 'text',
  47. 'list' => true,
  48. ),
  49. 'scope' => array
  50. (
  51. 'type' => 'tinyint-1',
  52. 'name' => '消息范围',
  53. 'default' => '1',
  54. 'desc' => '消息范围',
  55. 'match' => 'is_numeric',
  56. 'option' => $scope,
  57. 'update' => 'radio',
  58. 'search' => 'select',
  59. 'list' => true,
  60. ),
  61. 'type' => array
  62. (
  63. 'type' => 'tinyint-1',
  64. 'name' => '同步推送',
  65. 'default' => '1',
  66. 'desc' => '同步推送',
  67. 'match' => 'is_numeric',
  68. 'option' => $type,
  69. 'update' => 'radio',
  70. //'search' => 'select',
  71. 'list' => true,
  72. 'control' => 'type',
  73. ),
  74. 'push' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '推送方式',
  78. 'default' => '1',
  79. 'desc' => '推送方式',
  80. 'match' => 'is_numeric',
  81. 'option' => $push,
  82. 'update' => 'select',
  83. 'show' => 'type=2',
  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. 'default' => array
  108. (
  109. 'col' => 'id,name,type,scope,state,cdate',
  110. 'value' => array
  111. (
  112. '1, "系统消息",1, 1, 1,' . DEVER_TIME,
  113. ),
  114. ),
  115. # request 请求接口定义
  116. 'request' => array
  117. (
  118. ),
  119. );