123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651 |
- <?php
- $cate = function()
- {
- $array = array();
- $data = Dever::db('work/q_cate')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $branch = function()
- {
- $array = array();
- $data = Dever::db('work/branch')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $priority = function()
- {
- $array = array();
- $data = Dever::db('work/priority')->state();
- if($data)
- {
- foreach ($data as $k => $v) {
- $data[$k]['style'] = 'color:'.$v['color'];
- }
- $array += $data;
- }
- return $array;
- };
- $source = function()
- {
- $array = array();
- $data = Dever::db('work/q_source')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $question = function()
- {
- $array = array();
- $data = Dever::db('work/question')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $product = function()
- {
- $array = array();
- $data = Dever::db('work/product')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $status = array
- (
- // 1 => '全部',
- 1 => '待处理',
- 2 => '处理中',
- 3 => '完成关闭',
- 4 => '取消关闭',
- );
- $email = array
- (
- 1 => '不发送',
- 2 => '发送',
- );
- $admin = Dever::load("manage/auth.info");
- $admin_id = '';
- if ($admin) {
- $admin_id = $admin['id'];
- }
- #工单列表是1,我的工单列表2
- $search_auth = Dever::input('search_option_dever_auth', 1);
- $list_button = array();
- $list_button['location'] = array('查看详情',Dever::url('lib/appoint.show','work'));
- $list_button ['fast_add'] = array('指派工单','appoint&search_option_info_id={id}','{status}<3');
- $data = array();
- $insert = true;
- // $company = Dever::load('manage/company.get');
- if ($search_auth > 1) {
- $insert = false;
- if ($search_auth == 2) {
- $audit_admin = Dever::setInput('search_option_col', $admin_id);
- }
- if ($search_auth == 3) {
- $search_ids = Dever::load('work/lib/manage')->getMyTotal($admin_id,2);
- Dever::setInput('search_option_ids', $search_ids);
- }
-
- $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);
- $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);
- $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);
- $data[]= array('和我相关的',function() use($admin_id) {
- return Dever::load('work/lib/manage')->getmyTotal($admin_id,1);
- }, 'search_option_dever_auth=3&search_option_state=1');
- }
- $button = array();
- if ($search_auth == 1) {
- $button['回调界面'] = array('location',Dever::url('lib/appoint.callback','work'));
- // $button['电话回调界面'] = array('location',Dever::url('lib/appoint.callback','work'));
- }
- $excel = false;
- if (Dever::load('manage/auth')->checkFunc('work.info', 'infoedit', '数据导出')) {
- $excel[] = array('数据导出', '工单列表数据导出', 'work/lib/manage.out_info');
- }
- return array
- (
- # 表名
- 'name' => 'info',
- # 显示给用户看的名称
- 'lang' => '发起新工单',
- # 后台菜单排序
- 'order' => 100,
- // 'menu' => false,
- // 'auto' => 100000,
- 'start' => array
- (
- 'insert' => 'work/lib/manage.insertInfo',
- // 'update' => 'work/lib/manage.insertInfo',
- ),
- 'end' => array
- (
- 'insert' => 'work/lib/manage.updateInfo',
- 'update' => 'work/lib/manage.updateInfo',
- ),
- 'config_status' => $status,
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- ),
- 'company_id' => array
- (
- 'type' => 'int-11',
- 'name' => '所属公司',
- 'default' => '1',
- 'desc' => '所属公司',
- 'match' => 'is_numeric',
- 'update' => 'hidden',
- //'search' => $company ? 'select' : false,
- //'list' => true,
- ),
- 'mobile' => array
- (
- 'type' => 'bigint-11',
- 'name' => '手机号',
- 'default' => '',
- 'desc' => '请输入手机号',
- 'match' => Dever::rule('mobile'),
- // 'is_numeric',
- 'update' => 'text',
-
- 'value' => Dever::input('search_option_mobile'),
- # 绑定js脚本,更新时使用,第一个参数是执行的方式,第二个参数执行的方法,第三个参数是传值。
- 'bind' => array('onblur', 'loading', array('url' => Dever::url("lib/manage.search","work"))),
- 'list_name' => '客户信息',
- 'list' => 'Dever::load("work/lib/manage.getUser#user",{id})',#true,
- // '"Dever::load("work/lib/manage.getUser",{mobile})"',
- ),
- 'name' => array
- (
- 'type' => 'varchar-200',
- 'name' => '用户姓名(或微信名)',
- 'default' => '',
- 'desc' => '用户姓名(或微信名)',
- 'match' => 'option',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'work_num' => array
- (
- 'type' => 'varchar-100',
- 'name' => '姓名/手机号',
- 'default' => '',
- 'desc' => '工单号',
- 'match' => 'is_string',
- 'update' => 'hidden',
- 'search' => array
- (
- 'api' => 'work/info-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'id',
- ),
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'source' => array
- (
- 'type' => 'int-11',
- 'name' => '问题来源',
- 'default' => '1',
- 'desc' => '问题来源',
- 'match' => 'is_string',
- 'option' => $source,
- 'update' => 'radio',
- 'search' => $search_auth == 1 ? 'select' : false,
- // 'list' => true,
- ),
- 'cate_id' => array
- (
- 'type' => 'varchar-30',
- 'name' => '问题类型',
- 'default' => '-1',
- 'desc' => '问题类型',
- 'match' => 'is_string',
- 'search' => $search_auth == 1 ? 'linkage' : false,
- 'update' => 'linkage',
- 'option' => Dever::url('lib/appoint.getCate?level_total=2', 'work'),
- 'list' => 'Dever::load("work/lib/manage.getUser#cate_name",{id})',
- ),
- 'priority_id' => array
- (
- 'type' => 'int-11',
- 'name' => '优先级',
- 'default' => '1',
- 'desc' => '优先级',
- 'match' => 'is_string',
- 'option' => $priority,
- 'update' => 'radio',
- 'search' => $search_auth == 1 ? 'select' : false,
- 'list' => true,
- ),
- 'appoint_id' => array
- (
- 'type' => 'int-11',
- 'name' => '指派人',
- 'default' => '-1',
- 'desc' => '指派人',
- 'match' => 'is_string',
- // 'option' => $priority,
- // 'update' => 'select',
- // 'search' => 'select',
- // 'list' => true,
- ),
- 'desc' => array
- (
- 'type' => 'text-255',
- 'name' => '问题描述',
- 'default' => '',
- 'desc' => '问题描述',
- 'match' => 'is_string',
- 'update' => 'textarea',
- 'list' => true,
- ),
- 'pic' => array
- (
- 'type' => 'varchar-500',
- 'name' => '相关截图',
- 'default' => '',
- 'desc' => '请选择相关截图',
- 'match' => 'option',
- 'update' => 'images',
- 'key' => '1',
- //'place' => '150',
- ),
- 'video' => array
- (
- 'type' => 'varchar-500',
- 'name' => '相关视频',
- 'default' => '',
- 'desc' => '请选择相关视频',
- 'match' => 'option',
- 'update' => 'video',
- 'key' => '3',
- 'place' => '150',
- 'upload' => 'yun',
- 'large' => true,
- ),
- 'group' => array
- (
- 'type' => 'int-11',
- 'name' => '部门',
- 'default' => '',
- 'desc' => '部门',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'question' => array
- (
- 'type' => 'int-11',
- 'name' => '问题',
- 'default' => '',
- 'desc' => '问题',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'cate' => array
- (
- 'type' => 'int-11',
- 'name' => '分类',
- 'default' => '',
- 'desc' => '分类',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'product' => array
- (
- 'type' => 'int-11',
- 'name' => '系统产品',
- 'default' => '',
- 'desc' => '系统产品',
- 'match' => 'option',
- 'search' => 'select',
- 'update' => 'hidden',
- 'option' => $product,
- 'list' => true,
- ),
- 'branch_id' => array
- (
- 'type' => 'varchar-500',
- 'name' => '协助部门',
- 'default' => '',
- 'desc' => '协助部门',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'email' => array
- (
- 'type' => 'int-11',
- 'name' => '是否发送邮件',
- 'default' => '1',
- 'desc' => '是否发送邮件',
- 'match' => 'option',
- 'option' => $email,
- // 'search' => 'linkage',
- 'update' => 'radio',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'status' => array
- (
- 'type' => 'int-11',
- 'name' => '处理结果',
- 'default' => '1',
- 'desc' => '处理结果',
- 'match' => 'is_string',
- 'option' => $status,
- 'update' => 'radio',
- 'search' => 'select',
- 'list' => true,
- ),
- 'fdate' => array
- (
- 'type' => 'int-11',
- 'name' => '完成时间',
- 'default' => '',
- 'match' => 'is_numeric',
- // 'search' => 'date',
- 'list_name' => '时间/完成时间',
- // 'desc' => '',
- 'list' => 'Dever::load("work/lib/manage.getUSer#time",{id})',
- 'list_order' => 1,
- ),
- 'fpeople' => array
- (
- 'type' => 'int-11',
- 'name' => '完成人',
- 'default' => '',
- 'desc' => '完成人',
- 'match' => 'option',
- // 'search' => 'select',
- 'update' => 'hidden',
- // 'option' => $product,
- // 'list' => true,
- ),
- 'zdate' => array
- (
- 'type' => 'int-11',
- 'name' => '指派时间',
- 'default' => '',
- 'match' => 'is_numeric',
- // 'search' => 'date',
- ),
- 'chdate' => array
- (
- 'type' => 'int-11',
- 'name' => '处理时间',
- 'default' => '',
- 'match' => 'is_numeric',
- // 'search' => 'date',
- // 'desc' => '',
- ),
- 'audit_admin' => array
- (
- 'type' => 'int-11',
- 'name' => '工单创建人',
- 'default' => '',
- 'match' => 'is_numeric',
- 'desc' => '工单创建人',
- 'update' => 'hidden',
- 'insert' => true,
- 'value' => $admin_id,
- 'search' =>
- // 'Dever::load("work/lib/manage.getUSer#chuangjian",{id})',
- array
- (
- 'api' => 'manage/admin-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'audit_admin',
- ),
- 'list' => 'Dever::load("work/lib/manage.getUSer#chuangjian",{id})',
- ),
- 'dever_auth' => array
- (
- 'name' => '搜索',
- 'default' => '',
- 'desc' => '类型',
- 'match' => 'is_string',
- 'search' => 'hidden',
- ),
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序-数值越大越靠前',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- // 'update' => 'text',
- // 'search' => 'order',
- // 'list' => true,
- // 'order' => 'desc',
- // 'edit' => true,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '创建时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'search' => 'date',
- // 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'alter' => array
- (
-
- 4 => array
- (
- array('update', 'product','product','int-11 系统产品'),
- ),
- 'version' => 4,
- ),
- 'manage' => array
- (
- 'insert' => $insert,
- 'delete' => false,
- 'edit' => false,
- 'list_button' => $list_button,
- 'data' => $data,
- 'button' => $button,
- 'excel' => $excel,
- # 设置公司权限
- 'company' => 'company_id',
- ),
- 'request' => array
- (
- 'list_option' => array
- (
- 'col' => 'yes-appoint_id,audit_admin,fpeople',
- 'ids' => array('yes-id', 'in'),
- 'status' => array('yes', 'in'),
- 'state'=>1,
- ),
- 'getSearch' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'col' => array('yes-mobile,name', 'like'),
- ),
- 'type' => 'all',
- 'col' => '*|id',
- ),
- 'getTotal' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'audit_admin' => 'yes',
- 'appoint_id' => 'yes',
- 'fpeople' => 'yes',
- 'state' => 1,
- 'status'=> array('yes','in'),
- 'company_id'=>'yes',
- ),
- 'type' => 'count',
- // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => '*',
- ),
- 'getCount' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'group' => 'yes',
- 'state' => 1,
- 'id' => array('yes','in'),
- 'question' => array('yes','in'),
- 'start' => array('yes-cdate','>='),
- 'end' => array('yes-cdate','<='),
- 'status'=> array('yes','in'),
- 'fpeople' => array('yes','in'),
- ),
- 'type' => 'count',
- // 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => '*',
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'group' => 'yes',
- 'question' => 'yes',
- 'state' => 1,
- 'start' => array('yes-cdate','>='),
- 'end' => array('yes-cdate','<='),
- 'status'=> array('yes','in'),
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- 'col' => '*',
- ),
- 'getHAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mobile' =>'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- 'page' => array(5,'list'),
- 'col' => '*',
- ),
- 'getquestTotal' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'group' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'count',
- // 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-cdate','>='),
- 'end' => array('yes-cdate','<='),
- 'priority_id' =>'yes',
- 'cate' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'count',
- // 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getmyAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'audit_admin' =>'yes',
- 'cate' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- // 'order' => array('id' => 'desc'),
- 'col' => 'id as info_id',
- ),
- ),
- );
|