question.php 6.7 KB

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