question.php 5.7 KB

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