info.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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('work/branch')->state();
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $priority = function()
  23. {
  24. $array = array();
  25. $data = Dever::db('work/priority')->state();
  26. if($data)
  27. {
  28. foreach ($data as $k => $v) {
  29. $data[$k]['style'] = 'color:'.$v['color'];
  30. }
  31. $array += $data;
  32. }
  33. return $array;
  34. };
  35. $source = function()
  36. {
  37. $array = array();
  38. $data = Dever::db('work/q_source')->state();
  39. if($data)
  40. {
  41. $array += $data;
  42. }
  43. return $array;
  44. };
  45. $question = function()
  46. {
  47. $array = array();
  48. $data = Dever::db('work/question')->state();
  49. if($data)
  50. {
  51. $array += $data;
  52. }
  53. return $array;
  54. };
  55. $product = function()
  56. {
  57. $array = array();
  58. $data = Dever::db('work/product')->state();
  59. if($data)
  60. {
  61. $array += $data;
  62. }
  63. return $array;
  64. };
  65. $status = array
  66. (
  67. // 1 => '全部',
  68. 1 => '待处理',
  69. 2 => '处理中',
  70. 3 => '完成关闭',
  71. 4 => '取消关闭',
  72. );
  73. $admin = Dever::load("manage/auth.info");
  74. $admin_id = '';
  75. if ($admin) {
  76. $admin_id = $admin['id'];
  77. }
  78. #工单列表是1,我的工单列表2
  79. $search_auth = Dever::input('search_option_dever_auth', 1);
  80. $list_button = array();
  81. $list_button['location'] = array('查看详情',Dever::url('lib/appoint.show','work'));
  82. $list_button ['fast_add'] = array('指派工单','appoint&search_option_info_id={id}','{status}<3');
  83. $data = array();
  84. $insert = true;
  85. // $company = Dever::load('manage/company.get');
  86. if ($search_auth == 2) {
  87. $insert = false;
  88. $audit_admin = Dever::setInput('search_option_col', $admin_id);
  89. $data[]= array('待我处理',function() use ($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,2);}, 'search_option_dever_auth=2&search_option_status=2&search_option_appoint_id=' . $admin_id);
  90. $data[]= array('处理完成',function() use($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,'3,4');}, 'search_option_dever_auth=2&search_option_status=3&search_option_appoint_id=' . $admin_id);
  91. $data[]= array('我创建的',function() use($admin_id) {return Dever::load('work/lib/manage')->getTotal($admin_id,false);}, 'search_option_dever_auth=2&search_option_audit_admin=' . $admin_id);
  92. }
  93. $button = array();
  94. if ($search_auth == 1) {
  95. $button['回调界面'] = array('location',Dever::url('lib/appoint.back','work'));
  96. // $button['电话回调界面'] = array('location',Dever::url('lib/appoint.callback','work'));
  97. }
  98. $excel = false;
  99. if (Dever::load('manage/auth')->checkFunc('work.info', 'infoedit', '数据导出')) {
  100. $excel[] = array('数据导出', '工单列表数据导出', 'work/lib/manage.out_info');
  101. }
  102. return array
  103. (
  104. # 表名
  105. 'name' => 'info',
  106. # 显示给用户看的名称
  107. 'lang' => '发起新工单',
  108. # 后台菜单排序
  109. 'order' => 100,
  110. // 'menu' => false,
  111. // 'auto' => 100000,
  112. 'end' => array
  113. (
  114. 'insert' => 'work/lib/manage.updateInfo',
  115. 'update' => 'work/lib/manage.updateInfo',
  116. ),
  117. 'config_status' => $status,
  118. # 数据结构
  119. 'struct' => array
  120. (
  121. 'id' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => 'ID',
  125. 'default' => '',
  126. 'desc' => '',
  127. 'match' => 'is_numeric',
  128. 'search' => 'order',
  129. 'list' => true,
  130. 'order' => 'desc',
  131. ),
  132. 'company_id' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '所属公司',
  136. 'default' => '1',
  137. 'desc' => '所属公司',
  138. 'match' => 'is_numeric',
  139. 'update' => 'hidden',
  140. //'search' => $company ? 'select' : false,
  141. //'list' => true,
  142. ),
  143. 'mobile' => array
  144. (
  145. 'type' => 'bigint-11',
  146. 'name' => '手机号/姓名',
  147. 'default' => '',
  148. 'desc' => '请输入手机号',
  149. 'match' => Dever::rule('mobile'),
  150. // 'is_numeric',
  151. 'update' => 'text',
  152. 'search' => array
  153. (
  154. 'api' => 'work/info-getSearch',
  155. 'col' => 'col',
  156. 'result' => 'id',
  157. 'search' => 'id',
  158. ),
  159. 'value' => Dever::input('search_option_mobile'),
  160. # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
  161. 'bind' => array('onblur', 'loading', array('url' => Dever::url("lib/manage.search","work"))),
  162. 'list_name' => '客户信息',
  163. 'list' => 'Dever::load("work/lib/manage.getUser#user",{id})',#true,
  164. // '"Dever::load("work/lib/manage.getUser",{mobile})"',
  165. ),
  166. 'name' => array
  167. (
  168. 'type' => 'varchar-200',
  169. 'name' => '用户姓名(或微信名)',
  170. 'default' => '',
  171. 'desc' => '用户姓名(或微信名)',
  172. 'match' => 'option',
  173. 'update' => 'text',
  174. // 'search' => 'fulltext',
  175. // 'list' => true,
  176. ),
  177. 'work_num' => array
  178. (
  179. 'type' => 'varchar-100',
  180. 'name' => '工单号',
  181. 'default' => '',
  182. 'desc' => '工单号',
  183. 'match' => 'is_string',
  184. 'update' => 'hidden',
  185. // 'search' => 'fulltext',
  186. // 'list' => true,
  187. ),
  188. 'source' => array
  189. (
  190. 'type' => 'int-11',
  191. 'name' => '问题来源',
  192. 'default' => '1',
  193. 'desc' => '问题来源',
  194. 'match' => 'is_string',
  195. 'option' => $source,
  196. 'update' => 'radio',
  197. 'search' => $search_auth == 1 ? 'select' : false,
  198. // 'list' => true,
  199. ),
  200. 'cate_id' => array
  201. (
  202. 'type' => 'varchar-30',
  203. 'name' => '问题类型',
  204. 'default' => '1',
  205. 'desc' => '问题类型',
  206. 'match' => 'is_string',
  207. 'search' => $search_auth == 1 ? 'linkage' : false,
  208. 'update' => 'linkage',
  209. 'option' => Dever::url('lib/appoint.getCate?level_total=2', 'work'),
  210. 'list' => 'Dever::load("work/lib/manage.getUser#cate_name",{id})',
  211. ),
  212. 'priority_id' => array
  213. (
  214. 'type' => 'int-11',
  215. 'name' => '优先级',
  216. 'default' => '1',
  217. 'desc' => '优先级',
  218. 'match' => 'is_string',
  219. 'option' => $priority,
  220. 'update' => 'radio',
  221. 'search' => $search_auth == 1 ? 'select' : false,
  222. 'list' => true,
  223. ),
  224. 'appoint_id' => array
  225. (
  226. 'type' => 'int-11',
  227. 'name' => '指派人',
  228. 'default' => '-1',
  229. 'desc' => '指派人',
  230. 'match' => 'is_string',
  231. // 'option' => $priority,
  232. // 'update' => 'select',
  233. // 'search' => 'select',
  234. // 'list' => true,
  235. ),
  236. 'desc' => array
  237. (
  238. 'type' => 'text-255',
  239. 'name' => '问题描述',
  240. 'default' => '',
  241. 'desc' => '问题描述',
  242. 'match' => 'is_string',
  243. 'update' => 'textarea',
  244. 'list' => true,
  245. ),
  246. 'pic' => array
  247. (
  248. 'type' => 'varchar-500',
  249. 'name' => '相关截图',
  250. 'default' => '',
  251. 'desc' => '请选择相关截图',
  252. 'match' => 'option',
  253. 'update' => 'images',
  254. 'key' => '1',
  255. //'place' => '150',
  256. ),
  257. 'video' => array
  258. (
  259. 'type' => 'varchar-500',
  260. 'name' => '相关视频',
  261. 'default' => '',
  262. 'desc' => '请选择相关视频',
  263. 'match' => 'option',
  264. 'update' => 'video',
  265. 'key' => '3',
  266. //'place' => '150',
  267. ),
  268. 'group' => array
  269. (
  270. 'type' => 'int-11',
  271. 'name' => '部门',
  272. 'default' => '',
  273. 'desc' => '部门',
  274. 'match' => 'option',
  275. // 'search' => 'linkage',
  276. 'update' => 'hidden',
  277. // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  278. ),
  279. 'question' => array
  280. (
  281. 'type' => 'int-11',
  282. 'name' => '问题',
  283. 'default' => '',
  284. 'desc' => '问题',
  285. 'match' => 'option',
  286. // 'search' => 'linkage',
  287. 'update' => 'hidden',
  288. // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  289. ),
  290. 'product' => array
  291. (
  292. 'type' => 'int-11',
  293. 'name' => '系统产品',
  294. 'default' => '',
  295. 'desc' => '系统产品',
  296. 'match' => 'option',
  297. 'search' => 'select',
  298. 'update' => 'hidden',
  299. 'option' => $product,
  300. 'list' => true,
  301. ),
  302. 'branch_id' => array
  303. (
  304. 'type' => 'varchar-500',
  305. 'name' => '协助部门',
  306. 'default' => '',
  307. 'desc' => '协助部门',
  308. 'match' => 'option',
  309. // 'search' => 'linkage',
  310. 'update' => 'linkage',
  311. 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  312. ),
  313. 'status' => array
  314. (
  315. 'type' => 'int-11',
  316. 'name' => '处理结果',
  317. 'default' => '1',
  318. 'desc' => '处理结果',
  319. 'match' => 'is_string',
  320. 'option' => $status,
  321. 'update' => 'radio',
  322. 'search' => 'select',
  323. 'list' => true,
  324. ),
  325. 'fdate' => array
  326. (
  327. 'type' => 'int-11',
  328. 'name' => '完成时间',
  329. 'default' => '',
  330. 'match' => 'is_numeric',
  331. // 'search' => 'date',
  332. 'list_name' => '时间/完成时间',
  333. // 'desc' => '',
  334. 'list' => 'Dever::load("work/lib/manage.getUSer#time",{id})',
  335. 'list_order' => 1,
  336. ),
  337. 'fpeople' => array
  338. (
  339. 'type' => 'int-11',
  340. 'name' => '完成人',
  341. 'default' => '',
  342. 'desc' => '完成人',
  343. 'match' => 'option',
  344. // 'search' => 'select',
  345. 'update' => 'hidden',
  346. // 'option' => $product,
  347. // 'list' => true,
  348. ),
  349. 'zdate' => array
  350. (
  351. 'type' => 'int-11',
  352. 'name' => '指派时间',
  353. 'default' => '',
  354. 'match' => 'is_numeric',
  355. // 'search' => 'date',
  356. ),
  357. 'chdate' => array
  358. (
  359. 'type' => 'int-11',
  360. 'name' => '处理时间',
  361. 'default' => '',
  362. 'match' => 'is_numeric',
  363. // 'search' => 'date',
  364. // 'desc' => '',
  365. ),
  366. 'audit_admin' => array
  367. (
  368. 'type' => 'int-11',
  369. 'name' => '工单创建人',
  370. 'default' => '',
  371. 'match' => 'is_numeric',
  372. 'desc' => '工单创建人',
  373. 'update' => 'hidden',
  374. 'value' => $admin_id,
  375. // 'list' => 'Dever::load("active/lib/manage.active#admin_name",{id})',
  376. ),
  377. 'dever_auth' => array
  378. (
  379. 'name' => '搜索',
  380. 'default' => '',
  381. 'desc' => '类型',
  382. 'match' => 'is_string',
  383. 'search' => 'hidden',
  384. ),
  385. 'reorder' => array
  386. (
  387. 'type' => 'int-11',
  388. 'name' => '排序-数值越大越靠前',
  389. 'default' => '1',
  390. 'desc' => '请输入排序',
  391. 'match' => 'option',
  392. // 'update' => 'text',
  393. // 'search' => 'order',
  394. // 'list' => true,
  395. // 'order' => 'desc',
  396. // 'edit' => true,
  397. ),
  398. 'state' => array
  399. (
  400. 'type' => 'tinyint-1',
  401. 'name' => '状态',
  402. 'default' => '1',
  403. 'desc' => '请选择状态',
  404. 'match' => 'is_numeric',
  405. ),
  406. 'cdate' => array
  407. (
  408. 'type' => 'int-11',
  409. 'name' => '创建时间',
  410. 'match' => array('is_numeric', time()),
  411. 'desc' => '',
  412. # 只有insert时才生效
  413. 'insert' => true,
  414. 'search' => 'date',
  415. // 'list' => 'date("Y-m-d H:i:s", {cdate})',
  416. ),
  417. ),
  418. 'alter' => array
  419. (
  420. 4 => array
  421. (
  422. array('update', 'product','product','int-11 系统产品'),
  423. ),
  424. 'version' => 4,
  425. ),
  426. 'manage' => array
  427. (
  428. 'insert' => $insert,
  429. 'delete' => false,
  430. 'edit' => false,
  431. 'list_button' => $list_button,
  432. 'data' => $data,
  433. 'button' => $button,
  434. 'excel' => $excel,
  435. # 设置公司权限
  436. 'company' => 'company_id',
  437. ),
  438. 'request' => array
  439. (
  440. 'list_option' => array
  441. (
  442. 'col' => 'yes-appoint_id,audit_admin,fpeople',
  443. ),
  444. 'getSearch' => array
  445. (
  446. # 匹配的正则或函数 选填项
  447. 'option' => array
  448. (
  449. 'col' => array('yes-mobile,name', 'like'),
  450. ),
  451. 'type' => 'all',
  452. 'col' => '*|id',
  453. ),
  454. 'getTotal' => array
  455. (
  456. # 匹配的正则或函数 选填项
  457. 'option' => array
  458. (
  459. 'audit_admin' => 'yes',
  460. 'appoint_id' => 'yes',
  461. 'fpeople' => 'yes',
  462. 'state' => 1,
  463. 'status'=> array('yes','in'),
  464. 'company_id'=>'yes',
  465. ),
  466. 'type' => 'count',
  467. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  468. 'col' => '*',
  469. ),
  470. 'getCount' => array
  471. (
  472. # 匹配的正则或函数 选填项
  473. 'option' => array
  474. (
  475. 'group' => 'yes',
  476. 'state' => 1,
  477. 'id' => array('yes','in'),
  478. 'question' => array('yes','in'),
  479. 'start' => array('yes-cdate','>='),
  480. 'end' => array('yes-cdate','<='),
  481. 'status'=> array('yes','in'),
  482. 'fpeople' => array('yes','in'),
  483. ),
  484. 'type' => 'count',
  485. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  486. 'col' => '*',
  487. ),
  488. 'getAll' => array
  489. (
  490. # 匹配的正则或函数 选填项
  491. 'option' => array
  492. (
  493. 'group' => 'yes',
  494. 'question' => 'yes',
  495. 'state' => 1,
  496. 'start' => array('yes-cdate','>='),
  497. 'end' => array('yes-cdate','<='),
  498. 'status'=> array('yes','in'),
  499. ),
  500. 'type' => 'all',
  501. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  502. 'col' => '*',
  503. ),
  504. 'getHAll' => array
  505. (
  506. # 匹配的正则或函数 选填项
  507. 'option' => array
  508. (
  509. 'mobile' =>'yes',
  510. 'state' => 1,
  511. ),
  512. 'type' => 'all',
  513. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  514. 'page' => array(5,'list'),
  515. 'col' => '*',
  516. ),
  517. 'getquestTotal' => array
  518. (
  519. # 匹配的正则或函数 选填项
  520. 'option' => array
  521. (
  522. 'group' => 'yes',
  523. 'state' => 1,
  524. ),
  525. 'type' => 'count',
  526. // 'order' => array('id' => 'desc'),
  527. 'col' => '*',
  528. ),
  529. ),
  530. );