version.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * tester
  4. */
  5. $user = function()
  6. {
  7. $array = array();
  8. $info = Dever::load('component/user-state');
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. $template = function()
  16. {
  17. $array = array();
  18. $info = Dever::load('component_applet/template-state');
  19. if($info)
  20. {
  21. $array += $info;
  22. }
  23. return $array;
  24. };
  25. return array
  26. (
  27. # 表名
  28. 'name' => 'version',
  29. # 显示给用户看的名称
  30. 'lang' => '版本管理',
  31. 'order' => 97,
  32. 'end' => array
  33. (
  34. 'insert' => array
  35. (
  36. 'component_applet/version.update',
  37. ),
  38. 'update' => array
  39. (
  40. 'component_applet/version.update',
  41. ),
  42. ),
  43. # 数据结构
  44. 'struct' => array
  45. (
  46. 'id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => 'ID',
  50. 'default' => '',
  51. 'desc' => '',
  52. 'match' => 'is_numeric',
  53. 'search' => 'order',
  54. //'list' => true,
  55. ),
  56. 'project_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '项目',
  60. 'default' => '',
  61. 'desc' => '请输入项目',
  62. 'match' => 'is_numeric',
  63. ),
  64. 'user' => array
  65. (
  66. 'type' => 'varchar-255',
  67. 'name' => '用户-不选择则获取所有用户',
  68. 'default' => '',
  69. 'desc' => '用户',
  70. 'match' => 'is_string',
  71. //'search' => 'order,fulltext',
  72. 'update' => 'checkbox',
  73. 'option' => $user,
  74. 'list' => true,
  75. ),
  76. 'name' => array
  77. (
  78. 'type' => 'varchar-60',
  79. 'name' => '版本号',
  80. 'default' => '',
  81. 'desc' => '版本号',
  82. 'match' => 'is_string',
  83. 'update' => 'text',
  84. 'list' => true,
  85. ),
  86. 'template_id' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '小程序模板',
  90. 'default' => '1',
  91. 'desc' => '小程序模板',
  92. 'match' => 'is_numeric',
  93. 'update' => 'select',
  94. 'option' => $template,
  95. 'list' => true,
  96. ),
  97. 'desc' => array
  98. (
  99. 'type' => 'varchar-255',
  100. 'name' => '版本描述',
  101. 'default' => '',
  102. 'desc' => '版本描述',
  103. 'match' => 'option',
  104. 'update' => 'textarea',
  105. //'list' => true,
  106. ),
  107. 'act_id' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '活动id',
  111. 'default' => '0',
  112. 'desc' => '活动id',
  113. 'match' => 'is_numeric',
  114. 'update' => 'text',
  115. //'list' => true,
  116. ),
  117. 'state' => array
  118. (
  119. 'type' => 'tinyint-1',
  120. 'name' => '状态',
  121. 'default' => '1',
  122. 'desc' => '请选择状态',
  123. 'match' => 'is_numeric',
  124. ),
  125. 'mdate' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '提交时间',
  129. 'match' => array('is_numeric', time()),
  130. 'desc' => '',
  131. 'default' => '',
  132. 'list' => 'date("Y-m-d H:i:s", {mdate})',
  133. ),
  134. 'cdate' => array
  135. (
  136. 'type' => 'int-11',
  137. 'name' => '录入时间',
  138. 'match' => array('is_numeric', time()),
  139. 'desc' => '',
  140. # 只有insert时才生效
  141. 'insert' => true,
  142. ),
  143. ),
  144. 'top' => Dever::config('base', 'component')->top,
  145. 'manage' => array
  146. (
  147. 'delete' => false,
  148. 'list_button' => array
  149. (
  150. 'list' => array('日志', '"version_log&search_option_version_id={id}&oper_parent=version"'),
  151. 'oper' => array('提审', '"component_applet/auditing.submit?id={id}"'),
  152. 'oper3' => array('撤回', '"component_applet/unaudit.submit?id={id}"'),
  153. 'oper1' => array('发布', '"component_applet/publish.submit?id={id}"'),
  154. 'oper2' => array('回退', '"component_applet/revert.submit?id={id}"'),
  155. ),
  156. ),
  157. );