company.php 3.9 KB

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