info.php 18 KB

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