info.php 20 KB

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