product.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => '-1', 'name' => '请选择'),
  7. );
  8. $data = Dever::db('work/pcate')->state();
  9. if($data)
  10. {
  11. $array += $data;
  12. }
  13. // print_R($array);die;
  14. return $array;
  15. };
  16. return array
  17. (
  18. # 表名
  19. 'name' => 'product',
  20. # 显示给用户看的名称
  21. 'lang' => '相关系统产品设置',
  22. # 后台菜单排序
  23. 'order' => 97,
  24. // 'menu' => false,
  25. // 'auto' => 100000,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'search' => 'order',
  37. 'list' => true,
  38. 'order' => 'desc',
  39. ),
  40. 'company_id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '所属公司',
  44. 'default' => '1',
  45. 'desc' => '所属公司',
  46. 'match' => 'is_numeric',
  47. 'update' => 'hidden',
  48. //'search' => $company ? 'select' : false,
  49. //'list' => true,
  50. ),
  51. 'name' => array
  52. (
  53. 'type' => 'varchar-200',
  54. 'name' => '名称',
  55. 'default' => '',
  56. 'desc' => '名称',
  57. 'match' => 'is_string',
  58. 'update' => 'text',
  59. 'search' => 'fulltext',
  60. 'list' => true,
  61. ),
  62. 'cate_id' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '产品类型',
  66. 'default' => '-1',
  67. 'desc' => '产品类型',
  68. 'match' => 'is_string',
  69. 'option' => $cate,
  70. 'update' => 'select',
  71. 'list' => true,
  72. ),
  73. 'admin_id' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '关联产品负责人',
  77. 'default' => '',
  78. 'desc' => '关联产品负责人',
  79. 'match' => 'option',
  80. 'search' => 'linkage',
  81. 'update' => 'linkage',
  82. 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  83. 'list' => "Dever::load('work/lib/manage.admin',{id})",
  84. ),
  85. 'reorder' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '排序-数值越大越靠前',
  89. 'default' => '1',
  90. 'desc' => '请输入排序',
  91. 'match' => 'option',
  92. 'update' => 'text',
  93. 'search' => 'order',
  94. 'list' => true,
  95. 'order' => 'desc',
  96. 'edit' => true,
  97. ),
  98. 'state' => array
  99. (
  100. 'type' => 'tinyint-1',
  101. 'name' => '状态',
  102. 'default' => '1',
  103. 'desc' => '请选择状态',
  104. 'match' => 'is_numeric',
  105. ),
  106. 'cdate' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '创建时间',
  110. 'match' => array('is_numeric', time()),
  111. 'desc' => '',
  112. # 只有insert时才生效
  113. 'insert' => true,
  114. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  115. ),
  116. ),
  117. 'manage' => array
  118. (
  119. //'insert' => false,
  120. 'delete' => false,
  121. // 'edit' => false,
  122. 'button' => array
  123. (
  124. '产品类型' => array('location', 'l=project/database/list&project=work&table=pcate&oper_table=product'),
  125. ),
  126. # 设置公司权限
  127. 'company' => 'company_id',
  128. ),
  129. 'request' => array
  130. (
  131. 'getData' => array
  132. (
  133. # 匹配的正则或函数 选填项
  134. 'option' => array
  135. (
  136. //'id' => array('yes', '!='),
  137. 'state' => 1,
  138. ),
  139. 'type' => 'all',
  140. 'order' => array('id' => 'desc'),
  141. 'col' => '*|id',
  142. ),
  143. 'getAll' => array
  144. (
  145. # 匹配的正则或函数 选填项
  146. 'option' => array
  147. (
  148. // 'id' => array('yes','>'),
  149. 'state' => 1,
  150. ),
  151. 'type' => 'all',
  152. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  153. 'col' => '*',
  154. ),
  155. ),
  156. );