company.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. # 常用的col
  3. $col = '*';
  4. $is_project = array
  5. (
  6. 1 => '全部可用',
  7. 2 => '部分可用',
  8. );
  9. $project = function()
  10. {
  11. $array = array();
  12. $data = Dever::db('manage/menu_group')->state();
  13. if($data)
  14. {
  15. $array += $data;
  16. }
  17. return $array;
  18. };
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'company',
  23. # 显示给用户看的名称
  24. 'lang' => '公司管理',
  25. 'order' => 7,
  26. 'menu' => false,
  27. 'end' => array
  28. (
  29. 'update' => 'manage/company.update',
  30. ),
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'list' => true,
  42. ),
  43. 'name' => array
  44. (
  45. 'type' => 'varchar-80',
  46. 'name' => '公司名称',
  47. 'default' => '',
  48. 'desc' => '公司名称',
  49. 'match' => 'is_string',
  50. 'update' => 'text',
  51. 'list' => true,
  52. 'search' => 'fulltext',
  53. ),
  54. 'is_project' => array
  55. (
  56. 'type' => 'tinyint-1',
  57. 'name' => '项目可用状态',
  58. 'default' => '1',
  59. 'desc' => '项目可用状态',
  60. 'match' => 'is_numeric',
  61. 'option' => $is_project,
  62. 'update' => 'radio',
  63. 'list' => true,
  64. 'control' => 'is_project',
  65. ),
  66. 'project' => array
  67. (
  68. 'type' => 'varchar-2000',
  69. 'name' => '可用项目',
  70. 'default' => '',
  71. 'desc' => '选择项目',
  72. 'match' => 'is_string',
  73. 'option' => $project,
  74. 'update' => 'checkbox',
  75. 'show' => 'is_project=2',
  76. //'list' => true,
  77. ),
  78. 'state' => array
  79. (
  80. 'type' => 'tinyint-1',
  81. 'name' => '状态',
  82. 'default' => '1',
  83. 'desc' => '请选择状态',
  84. 'match' => 'is_numeric',
  85. ),
  86. 'cdate' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '录入时间',
  90. 'match' => array('is_numeric', time()),
  91. 'desc' => '',
  92. # 只有insert时才生效
  93. 'insert' => true,
  94. 'list' => 'date("Y-m-d H:i", {cdate})',
  95. ),
  96. ),
  97. 'default' => array
  98. (
  99. 'col' => 'id,name,state,cdate',
  100. 'value' => array
  101. (
  102. '1,"默认公司", 1,' . DEVER_TIME,
  103. ),
  104. ),
  105. # 管理功能
  106. 'manage' => array
  107. (
  108. 'delete' => false,
  109. 'insert' => false,
  110. 'edit' => false,
  111. # 自定义快捷新增和编辑
  112. 'button' => array
  113. (
  114. '新增' => array('fast'),
  115. ),
  116. # 快捷更新
  117. 'list_button' => array
  118. (
  119. 'edit' => array('编辑'),
  120. ),
  121. ),
  122. 'request' => array
  123. (
  124. 'getIds' => array
  125. (
  126. 'type' => 'all',
  127. 'option' => array
  128. (
  129. 'ids' => array('yes-id', 'in'),
  130. 'state' => 1,
  131. ),
  132. 'order' => array('id' => 'desc'),
  133. 'col' => '*|id',
  134. ),
  135. 'getOld' => array
  136. (
  137. 'type' => 'all',
  138. 'option' => array
  139. (
  140. 'ids' => array('yes-id', 'in'),
  141. 'state' => 1,
  142. ),
  143. 'order' => array('id' => 'asc'),
  144. 'col' => '*',
  145. ),
  146. ),
  147. );