publish.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. /**
  3. * tester
  4. */
  5. $status = array
  6. (
  7. 1 => '发布中',
  8. 2 => '发布成功',
  9. 3 => '发布失败',
  10. );
  11. $user = function()
  12. {
  13. $array = array();
  14. $info = Dever::load('component/user-state');
  15. if($info)
  16. {
  17. $array += $info;
  18. }
  19. return $array;
  20. };
  21. $template = function()
  22. {
  23. $array = array();
  24. $info = Dever::load('component/template-state');
  25. if($info)
  26. {
  27. $array += $info;
  28. }
  29. return $array;
  30. };
  31. $version = function()
  32. {
  33. $array = array();
  34. $info = Dever::load('component/version-state');
  35. if($info)
  36. {
  37. $array += $info;
  38. }
  39. return $array;
  40. };
  41. return array
  42. (
  43. # 表名
  44. 'name' => 'publish',
  45. # 显示给用户看的名称
  46. 'lang' => '发布历史',
  47. 'order' => 1,
  48. # 数据结构
  49. 'struct' => array
  50. (
  51. 'id' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => 'ID',
  55. 'default' => '',
  56. 'desc' => '',
  57. 'match' => 'is_numeric',
  58. 'search' => 'order',
  59. //'list' => true,
  60. ),
  61. 'project_id' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '项目',
  65. 'default' => '',
  66. 'desc' => '请输入项目',
  67. 'match' => 'is_numeric',
  68. ),
  69. 'version_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '版本',
  73. 'default' => '',
  74. 'desc' => '版本',
  75. 'match' => 'is_numeric',
  76. //'search' => 'order,fulltext',
  77. 'update' => 'checkbox',
  78. 'option' => $version,
  79. 'list' => true,
  80. ),
  81. 'user_id' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '用户',
  85. 'default' => '',
  86. 'desc' => '用户',
  87. 'match' => 'is_numeric',
  88. //'search' => 'order,fulltext',
  89. 'update' => 'select',
  90. 'option' => $user,
  91. 'list' => true,
  92. ),
  93. 'result' => array
  94. (
  95. 'type' => 'text-255',
  96. 'name' => '微信返回信息',
  97. 'default' => '',
  98. 'desc' => '微信返回信息',
  99. 'match' => 'option',
  100. 'update' => 'textarea',
  101. 'list' => true,
  102. 'modal' => '查看详情',
  103. ),
  104. 'status' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '发布状态',
  108. 'default' => '1',
  109. 'desc' => '发布状态',
  110. 'match' => 'is_numeric',
  111. 'update' => 'select',
  112. 'option' => $status,
  113. 'list' => true,
  114. ),
  115. 'state' => array
  116. (
  117. 'type' => 'tinyint-1',
  118. 'name' => '状态',
  119. 'default' => '1',
  120. 'desc' => '请选择状态',
  121. 'match' => 'is_numeric',
  122. ),
  123. 'cdate' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '提交时间',
  127. 'match' => array('is_numeric', time()),
  128. 'desc' => '',
  129. # 只有insert时才生效
  130. 'insert' => true,
  131. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  132. ),
  133. ),
  134. 'top' => Dever::config('base', 'component')->top,
  135. 'manage' => array
  136. (
  137. 'edit' => false,
  138. 'delete' => false,
  139. 'insert' => false,
  140. ),
  141. );