info.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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' => 'is_numeric',
  150. 'update' => 'text',
  151. 'search' => array
  152. (
  153. 'api' => 'work/info-getSearch',
  154. 'col' => 'col',
  155. 'result' => 'id',
  156. 'search' => 'id',
  157. ),
  158. 'value' => Dever::input('search_option_mobile'),
  159. # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
  160. 'bind' => array('onblur', 'loading', array('url' => Dever::url("lib/manage.search","work"))),
  161. 'list_name' => '客户信息',
  162. 'list' => 'Dever::load("work/lib/manage.getUser#user",{id})',#true,
  163. // '"Dever::load("work/lib/manage.getUser",{mobile})"',
  164. ),
  165. 'name' => array
  166. (
  167. 'type' => 'varchar-200',
  168. 'name' => '用户姓名(或微信名)',
  169. 'default' => '',
  170. 'desc' => '用户姓名(或微信名)',
  171. 'match' => 'option',
  172. 'update' => 'text',
  173. // 'search' => 'fulltext',
  174. // 'list' => true,
  175. ),
  176. 'work_num' => array
  177. (
  178. 'type' => 'varchar-100',
  179. 'name' => '工单号',
  180. 'default' => '',
  181. 'desc' => '工单号',
  182. 'match' => 'is_string',
  183. 'update' => 'hidden',
  184. // 'search' => 'fulltext',
  185. // 'list' => true,
  186. ),
  187. 'source' => array
  188. (
  189. 'type' => 'int-11',
  190. 'name' => '问题来源',
  191. 'default' => '1',
  192. 'desc' => '问题来源',
  193. 'match' => 'is_string',
  194. 'option' => $source,
  195. 'update' => 'radio',
  196. 'search' => $search_auth == 1 ? 'select' : false,
  197. // 'list' => true,
  198. ),
  199. 'cate_id' => array
  200. (
  201. 'type' => 'varchar-30',
  202. 'name' => '问题类型',
  203. 'default' => '-1',
  204. 'desc' => '问题类型',
  205. 'match' => 'is_string',
  206. 'search' => $search_auth == 1 ? 'linkage' : false,
  207. 'update' => 'linkage',
  208. 'option' => Dever::url('lib/appoint.getCate?level_total=2', 'work'),
  209. 'list' => 'Dever::load("work/lib/manage.getUser#cate_name",{id})',
  210. ),
  211. 'priority_id' => array
  212. (
  213. 'type' => 'int-11',
  214. 'name' => '优先级',
  215. 'default' => '1',
  216. 'desc' => '优先级',
  217. 'match' => 'is_string',
  218. 'option' => $priority,
  219. 'update' => 'radio',
  220. 'search' => $search_auth == 1 ? 'select' : false,
  221. 'list' => true,
  222. ),
  223. 'appoint_id' => array
  224. (
  225. 'type' => 'int-11',
  226. 'name' => '指派人',
  227. 'default' => '-1',
  228. 'desc' => '指派人',
  229. 'match' => 'is_string',
  230. // 'option' => $priority,
  231. // 'update' => 'select',
  232. // 'search' => 'select',
  233. // 'list' => true,
  234. ),
  235. 'desc' => array
  236. (
  237. 'type' => 'text-255',
  238. 'name' => '问题描述',
  239. 'default' => '',
  240. 'desc' => '问题描述',
  241. 'match' => 'is_string',
  242. 'update' => 'textarea',
  243. 'list' => true,
  244. ),
  245. 'pic' => array
  246. (
  247. 'type' => 'varchar-500',
  248. 'name' => '相关截图',
  249. 'default' => '',
  250. 'desc' => '请选择相关截图',
  251. 'match' => 'option',
  252. 'update' => 'images',
  253. 'key' => '1',
  254. //'place' => '150',
  255. ),
  256. 'video' => array
  257. (
  258. 'type' => 'varchar-500',
  259. 'name' => '相关视频',
  260. 'default' => '',
  261. 'desc' => '请选择相关视频',
  262. 'match' => 'option',
  263. 'update' => 'video',
  264. 'key' => '3',
  265. //'place' => '150',
  266. ),
  267. 'group' => array
  268. (
  269. 'type' => 'int-11',
  270. 'name' => '部门',
  271. 'default' => '',
  272. 'desc' => '部门',
  273. 'match' => 'option',
  274. // 'search' => 'linkage',
  275. 'update' => 'hidden',
  276. // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  277. ),
  278. 'question' => array
  279. (
  280. 'type' => 'int-11',
  281. 'name' => '问题',
  282. 'default' => '',
  283. 'desc' => '问题',
  284. 'match' => 'option',
  285. // 'search' => 'linkage',
  286. 'update' => 'hidden',
  287. // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  288. ),
  289. 'product' => array
  290. (
  291. 'type' => 'int-11',
  292. 'name' => '系统产品',
  293. 'default' => '',
  294. 'desc' => '系统产品',
  295. 'match' => 'option',
  296. 'search' => 'select',
  297. 'update' => 'hidden',
  298. 'option' => $product,
  299. 'list' => true,
  300. ),
  301. 'branch_id' => array
  302. (
  303. 'type' => 'varchar-500',
  304. 'name' => '协助部门',
  305. 'default' => '',
  306. 'desc' => '协助部门',
  307. 'match' => 'option',
  308. // 'search' => 'linkage',
  309. 'update' => 'linkage',
  310. 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
  311. ),
  312. 'status' => array
  313. (
  314. 'type' => 'int-11',
  315. 'name' => '处理结果',
  316. 'default' => '1',
  317. 'desc' => '处理结果',
  318. 'match' => 'is_string',
  319. 'option' => $status,
  320. 'update' => 'radio',
  321. 'search' => 'select',
  322. 'list' => true,
  323. ),
  324. 'fdate' => array
  325. (
  326. 'type' => 'int-11',
  327. 'name' => '完成时间',
  328. 'default' => '',
  329. 'match' => 'is_numeric',
  330. // 'search' => 'date',
  331. 'list_name' => '时间/完成时间',
  332. // 'desc' => '',
  333. 'list' => 'Dever::load("work/lib/manage.getUSer#time",{id})',
  334. 'list_order' => 1,
  335. ),
  336. 'fpeople' => array
  337. (
  338. 'type' => 'int-11',
  339. 'name' => '完成人',
  340. 'default' => '',
  341. 'desc' => '完成人',
  342. 'match' => 'option',
  343. // 'search' => 'select',
  344. 'update' => 'hidden',
  345. // 'option' => $product,
  346. // 'list' => true,
  347. ),
  348. 'zdate' => array
  349. (
  350. 'type' => 'int-11',
  351. 'name' => '指派时间',
  352. 'default' => '',
  353. 'match' => 'is_numeric',
  354. // 'search' => 'date',
  355. ),
  356. 'chdate' => array
  357. (
  358. 'type' => 'int-11',
  359. 'name' => '处理时间',
  360. 'default' => '',
  361. 'match' => 'is_numeric',
  362. // 'search' => 'date',
  363. // 'desc' => '',
  364. ),
  365. 'audit_admin' => array
  366. (
  367. 'type' => 'int-11',
  368. 'name' => '工单创建人',
  369. 'default' => '',
  370. 'match' => 'is_numeric',
  371. 'desc' => '工单创建人',
  372. 'update' => 'hidden',
  373. 'value' => $admin_id,
  374. // 'list' => 'Dever::load("active/lib/manage.active#admin_name",{id})',
  375. ),
  376. 'dever_auth' => array
  377. (
  378. 'name' => '搜索',
  379. 'default' => '',
  380. 'desc' => '类型',
  381. 'match' => 'is_string',
  382. 'search' => 'hidden',
  383. ),
  384. 'reorder' => array
  385. (
  386. 'type' => 'int-11',
  387. 'name' => '排序-数值越大越靠前',
  388. 'default' => '1',
  389. 'desc' => '请输入排序',
  390. 'match' => 'option',
  391. // 'update' => 'text',
  392. // 'search' => 'order',
  393. // 'list' => true,
  394. // 'order' => 'desc',
  395. // 'edit' => true,
  396. ),
  397. 'state' => array
  398. (
  399. 'type' => 'tinyint-1',
  400. 'name' => '状态',
  401. 'default' => '1',
  402. 'desc' => '请选择状态',
  403. 'match' => 'is_numeric',
  404. ),
  405. 'cdate' => array
  406. (
  407. 'type' => 'int-11',
  408. 'name' => '创建时间',
  409. 'match' => array('is_numeric', time()),
  410. 'desc' => '',
  411. # 只有insert时才生效
  412. 'insert' => true,
  413. 'search' => 'date',
  414. // 'list' => 'date("Y-m-d H:i:s", {cdate})',
  415. ),
  416. ),
  417. 'alter' => array
  418. (
  419. 4 => array
  420. (
  421. array('update', 'product','product','int-11 系统产品'),
  422. ),
  423. 'version' => 4,
  424. ),
  425. 'manage' => array
  426. (
  427. 'insert' => $insert,
  428. 'delete' => false,
  429. 'edit' => false,
  430. 'list_button' => $list_button,
  431. 'data' => $data,
  432. 'button' => $button,
  433. 'excel' => $excel,
  434. # 设置公司权限
  435. 'company' => 'company_id',
  436. ),
  437. 'request' => array
  438. (
  439. 'list_option' => array
  440. (
  441. 'col' => 'yes-appoint_id,audit_admin,fpeople',
  442. ),
  443. 'getSearch' => array
  444. (
  445. # 匹配的正则或函数 选填项
  446. 'option' => array
  447. (
  448. 'col' => array('yes-mobile,name', 'like'),
  449. ),
  450. 'type' => 'all',
  451. 'col' => '*|id',
  452. ),
  453. 'getTotal' => array
  454. (
  455. # 匹配的正则或函数 选填项
  456. 'option' => array
  457. (
  458. 'audit_admin' => 'yes',
  459. 'appoint_id' => 'yes',
  460. 'fpeople' => 'yes',
  461. 'state' => 1,
  462. 'status'=> array('yes','in'),
  463. 'company_id'=>'yes',
  464. ),
  465. 'type' => 'count',
  466. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  467. 'col' => '*',
  468. ),
  469. 'getCount' => array
  470. (
  471. # 匹配的正则或函数 选填项
  472. 'option' => array
  473. (
  474. 'group' => 'yes',
  475. 'state' => 1,
  476. 'id' => array('yes','in'),
  477. 'question' => array('yes','in'),
  478. 'start' => array('yes-cdate','>='),
  479. 'end' => array('yes-cdate','<='),
  480. 'status'=> array('yes','in'),
  481. 'fpeople' => array('yes','in'),
  482. ),
  483. 'type' => 'count',
  484. // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  485. 'col' => '*',
  486. ),
  487. 'getAll' => array
  488. (
  489. # 匹配的正则或函数 选填项
  490. 'option' => array
  491. (
  492. 'group' => 'yes',
  493. 'question' => 'yes',
  494. 'state' => 1,
  495. 'start' => array('yes-cdate','>='),
  496. 'end' => array('yes-cdate','<='),
  497. 'status'=> array('yes','in'),
  498. ),
  499. 'type' => 'all',
  500. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  501. 'col' => '*',
  502. ),
  503. 'getHAll' => array
  504. (
  505. # 匹配的正则或函数 选填项
  506. 'option' => array
  507. (
  508. 'mobile' =>'yes',
  509. 'state' => 1,
  510. ),
  511. 'type' => 'all',
  512. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  513. 'page' => array(5,'list'),
  514. 'col' => '*',
  515. ),
  516. 'getquestTotal' => array
  517. (
  518. # 匹配的正则或函数 选填项
  519. 'option' => array
  520. (
  521. 'group' => 'yes',
  522. 'state' => 1,
  523. ),
  524. 'type' => 'count',
  525. // 'order' => array('id' => 'desc'),
  526. 'col' => '*',
  527. ),
  528. ),
  529. );