123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664 |
- <?php
- $people = function()
- {
- $array = array();
- $data = Dever::db('clue/user_set')->state();
- if($data)
- {
-
- $array += $data;
- }
- return $array;
- };
- $source = function()
- {
- $array = array();
- $data = Dever::db('clue/source')->state(array('type'=>1));
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $status = function()
- {
- $array = array();
- $data = Dever::db('clue/sale_status')->state();
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- // $selepeople = function()
- // {
- // $array = array();
- // $data = Dever::db('clue/salepeople')->state();
- // if($data)
- // {
- // foreach ($data as $k => $v) {
- // $data[$k]['name'] = $v['group'];
- // }
- // $array += $data;
- // }
- // return $array;
- // };
- $sex = array
- (
- 1 => '未知',
- 2 => '男',
- 3 => '女',
- );
- $type = array
- (
- 1 => '待分派',
- 2 => '待跟进',
- 3 => '已跟进',
- 4 => '已完成',
- 5 => '已关闭',
- 6 => '未跟进',
- );
- $out_type = array
- (
- 1 => '否',
- 2 => '是',
- );
- $admin = Dever::load("manage/auth.info");
- $admin_id = '';
- if ($admin) {
- $admin_id = $admin['id'];
- }
- $search_auth = Dever::input('search_option_dever_auth', 2);
- if ($search_auth ==2) {
- $company = Dever::load('manage/company.get');
- $admin = Dever::db('manage/admin')->find($admin_id);
- if ($admin) {
- $admin['group'] = explode(',',$admin['group']);
- foreach ($admin['group'] as $k =>$v) {
- $group = Dever::db('manage/group')->find(array('company_id'=>$company,'id'=>$v));
- }
- if ($group) {
- $work = Dever::db('work/branch')->find(array('group_id'=>$group['id']));
- if ($work) {
- $work['group'] = explode(',',$work['group']);
- if (isset($work['group'][1]) && $work['group'][1] && $work['group'][1] == $admin_id) {
- $audit_group = Dever::setInput('search_option_follow_group_id', $group['id']);
- } else {
- $audit_admin = Dever::setInput('search_option_follow_admin_id', $admin_id);
- }
- }
- }
- }
- }
- $list_button = array();
- $list_button['location'] = array('查看详情',Dever::url('lib/info.show','clue'));
- $list_button ['fast_add'] = array('转派','info&where_id={id}&col=follow', '{type}<4 || {type}>5');
- $excel[] = array('数据导出','线索列表数据导出', 'clue/lib/manage.out_info');
- $button = array();
- $button['线索导入'] = array('fast','','import&project=clue&call=clue/lib/manage.import');
- $col = Dever::input('col');
- $mul = false;
- // if (Dever::load('manage/auth')->checkFunc('menu_61.menu_85', 'piliangfafang', '批量收货')) {
- // $mul = '({type} < 4 || {type} > 5)';
- // } elseif (Dever::load('manage/auth')->checkFunc('menu_61.menu_218', 'piliangfafang', '批量收货')) {
- // $mul = '({status} == 4 || {status} == 2) && {shop_type} == 2';
- // }
- return array
- (
- # 表名
- 'name' => 'info',
- # 显示给用户看的名称
- 'lang' => '创建新线索',
- # 后台菜单排序
- 'order' => 100,
- // 'menu' => false,
- // 'auto' => 100000,
- 'start' => array
- (
- 'insert' => 'clue/lib/info.insertInfo',
- // 'updatemul' => 'clue/lib/info.setInfoFollow',
- // 'update' => 'clue/lib/info.insertInfo',
- ),
- 'end' => array
- (
- 'insert' => 'clue/lib/info.updateInfo',
- 'update' => 'clue/lib/info.updateInfo',
- // 'updatemul' => 'clue/lib/info.setInfoFollow',
- ),
- 'config_type' => $type,
- 'config_sex' => $sex,
- # 数据结构
- '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,
- ),
- 'day' => array
- (
- 'type' => 'int-11',
- 'name' => '计划下次跟进时间',
- 'default' => '',
- 'match' => 'is_numeric',
- 'desc' => '',
- 'search' => 'sdate',
- 'search_buttons' => array
- (
- // 'sum' => 'buy_num,buy_cash,sell_num,sell_cash,sl_num',
- 'option' => array(
- 'day' => '按天',
- 'week' => '按周',
- 'month' => '按月',
- ),
- // 'group' => 'id',
- ),
- // 'order' => 'desc',
- 'list' => 'Dever::load("clue/lib/info.getNum#xdate",{id})',
- // 'Dever::showDay("{day}")',
- 'list_order' => 5,
- ),
- 'name' => array
- (
- 'type' => 'varchar-32',
- 'name' => '用户姓名',
- 'default' => '',
- 'desc' => '用户姓名',
- 'match' => 'is_string',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'mobile' => array
- (
- 'type' => 'bigint-11',
- 'name' => '手机号',
- 'default' => '',
- 'desc' => '请输入手机号',
- 'match' => Dever::rule('mobile'),
- 'update' => 'text',
- 'search' => 'fulltext',
- // 'value' => Dever::input('search_option_mobile'),
- 'list_name' => '客户信息',
- 'list' => 'Dever::load("clue/lib/info.getNum#user",{id})',#true,
- 'list_order' => 2,
- ),
- 'wechat' => array
- (
- 'type' => 'varchar-32',
- 'name' => '微信号',
- 'default' => '',
- 'desc' => '微信号',
- 'match' => 'option',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'qq' => array
- (
- 'type' => 'varchar-32',
- 'name' => 'QQ号',
- 'default' => '',
- 'desc' => 'QQ号',
- 'match' => 'option',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'source' => array
- (
- 'type' => 'int-11',
- 'name' => '来源',
- 'default' => '1',
- 'desc' => '来源',
- 'match' => 'is_string',
- 'option' => $source,
- 'update' => 'radio',
- 'search' => 'select',
- 'list' => true,
- ),
- 'area' => array
- (
- 'type' => 'varchar-32',
- 'name' => '所在城市',
- 'default' => '',
- 'desc' => '所在城市',
- 'match' => 'option',
- 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('api.get?level_total=2', 'area'),
- 'list' => 'Dever::load("clue/lib/info.getNum#area",{id})',
- ),
- 'clue_num' => array
- (
- 'type' => 'varchar-50',
- 'name' => '线索编号',
- 'default' => '',
- 'desc' => '线索编号',
- 'match' => 'is_string',
- 'update' => 'hidden',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'sex' => array
- (
- 'type' => 'int-11',
- 'name' => '性别',
- 'default' => '1',
- 'desc' => '性别',
- 'match' => 'is_string',
- 'option' => $sex,
- 'update' => 'radio',
- // 'search' => 'select',
- // 'list' => true,
- ),
- 'age' => array
- (
- 'type' => 'varchar-32',
- 'name' => '年龄',
- 'default' => '',
- 'desc' => '年龄',
- 'match' => 'option',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list' => true,
- ),
- 'trade' => array
- (
- 'type' => 'varchar-50',
- 'name' => '行业',
- 'default' => '',
- 'desc' => '行业',
- 'match' => 'option',
- 'update' => 'text',
- // 'search' => 'fulltext',
- // 'list_name' => '计划下次跟进时间',
- // 'list' => 'Dever::load("clue/lib/info.getNum#xdate",{id})',
- // 'list_order' => 5,
- ),
-
- 'desc' => array
- (
- 'type' => 'text-100',
- 'name' => '竞品了解',
- 'default' => '',
- 'desc' => '竞品了解',
- 'match' => 'option',
- 'update' => 'textarea',
- // 'list_name' => '跟进次数',
- // 'list' => 'Dever::load("clue/lib/info.getNum#num",{id})',
- // 'list_order' => 4,
- ),
- 'num' => array
- (
- 'type' => 'int-11',
- 'name' => '跟进次数',
- 'default' => '0',
- 'desc' => '数量',
- 'match' => 'option',
- 'update' => 'hidden',
- 'list' => 'Dever::load("clue/lib/info.getNum#num",{id})',
- 'list_order' => 4,
- ),
- 'userset_id' => array
- (
- 'type' => 'int-11',
- 'name' => '客户等级',
- 'default' => '-1',
- 'desc' => '客户等级',
- 'match' => 'is_string',
- 'search' => 'select',
- 'update' => 'select',
- 'option' => $people,
- 'list' => true,
- 'list_order' => 3,
- ),
- 'status_id' => array
- (
- 'type' => 'int-11',
- 'name' => '线索状态',
- 'default' => '1',
- 'desc' => '线索状态',
- 'match' => 'is_string',
- 'option' => $status,
- 'update' => 'select',
- // 'search' => $search_auth == 1 ? 'select' : false,
- // 'list' => true,
- 'control' => 'status_id',
- ),
- 'out_type' => array
- (
- 'type' => 'int-11',
- 'name' => '是否导入',
- 'default' => '1',
- 'desc' => '是否导入',
- 'match' => 'is_string',
- 'option' => $out_type,
- // 'update' => 'select',
- // 'search' => $search_auth == 1 ? 'select' : false,
- // 'list' => true,
- // 'control' => 'status_id',
- ),
- 'status_desc' => array
- (
- 'type' => 'text-255',
- 'name' => '结论备注',
- 'default' => '',
- 'desc' => '结论备注',
- 'match' => 'is_string',
- 'update' => 'textarea',
- 'update' => $col ? 'textarea' : false,
- 'show' => 'status_id=5,6',
- // 'list' => true,
- ),
- 'follow_id' => array
- (
- 'type' => 'int-11',
- 'name' => '跟进人表id',
- 'default' => '-1',
- 'desc' => '跟进人',
- 'match' => 'is_string',
- // 'option' => $priority,
- // 'update' => 'select',
- // 'search' => 'select',
- // 'list' => true,
- ),
- 'follow' => array
- (
- 'type' => 'varchar-32',
- 'name' => $col ? '选择队友' : '分派销售员',
- 'default' => '',
- 'desc' => '分派销售员',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('lib/salepeople.get?level_total=2', 'clue'),
- // $salepeople,
- 'list_name' => '跟进人',
- 'list' => 'Dever::load("clue/lib/info.getNum#people",{id})',
- // 'mul' => true,
- // 'mul_option' => Dever::url('lib/salepeople.get?level_total=2', 'clue'),
- ),
- 'follow_admin_id' => array
- (
- 'type' => 'int-11',
- 'name' => '跟进人',
- 'default' => '-1',
- 'desc' => '跟进人',
- 'match' => 'is_string',
- // 'value' => $audit_admin,
- // 'option' => $priority,
- // 'update' => 'select',
- // 'search' => 'select',
- // 'list' => true,
- ),
- 'follow_group_id' => array
- (
- 'type' => 'int-11',
- 'name' => '部门',
- 'default' => '',
- 'desc' => '部门',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'create_group_id' => array
- (
- 'type' => 'int-11',
- 'name' => '创建人部门',
- 'default' => '',
- 'desc' => '部门',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'create_admin_id' => array
- (
- 'type' => 'int-11',
- 'name' => '创建人',
- 'default' => '',
- 'desc' => '部门',
- 'match' => 'option',
- // 'search' => 'linkage',
- 'update' => 'hidden',
- // 'option' => Dever::url('lib/appoint.get?level_total=2', 'work'),
- ),
- 'fdate' => array
- (
- 'type' => 'int-11',
- 'name' => '完成时间',
- 'default' => '',
- 'match' => 'is_numeric',
- // 'search' => 'date',
- 'list_name' => '创建时间<br/>最近跟进时间',
- // 'desc' => '',
- 'list' => 'Dever::load("clue/lib/info.getNum#time",{id})',
- 'list_order' => 1,
- ),
- 'gdate' => array
- (
- 'type' => 'int-11',
- 'name' => '跟进时间',
- 'default' => '',
- 'match' => 'is_numeric',
- // 'search' => 'date',
- ),
- 'type' => array
- (
- 'type' => 'int-11',
- 'name' => '跟进状态',
- 'default' => '1',
- 'desc' => '跟进状态',
- 'match' => 'is_string',
- 'option' => $type,
- // 'update' => 'select',
- 'search' => 'select',
- 'list' => true,
- // 'list_order' => 22,
- ),
- 'audit_admin' => array
- (
- 'type' => 'int-11',
- 'name' => '创建人',
- 'default' => '',
- 'match' => 'is_numeric',
- 'desc' => '创建人',
- 'update' => 'hidden',
- 'value' => $admin_id,
- // 'list' => 'Dever::load("active/lib/manage.active#admin_name",{id})',
- ),
- 'dever_auth' => array
- (
- 'name' => '搜索',
- 'default' => '',
- 'desc' => '类型',
- 'match' => 'is_string',
- 'search' => 'hidden',
- ),
- 'remark' => array
- (
- 'type' => 'text-255',
- 'name' => '备注',
- 'default' => '',
- 'desc' => '备注',
- 'match' => 'option',
- 'update' => 'textarea',
- // 'list' => true,
- ),
- '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',
- // 'order' => 'desc',
- // 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- // 'insert' => true,
- 'delete' => false,
- 'edit' => false,
- 'list_button' => $list_button,
- // 'data' => $data,
- 'button' => $button,
- 'excel' => $excel,
- 'mul' =>$mul,
- # 设置公司权限
- 'company' => 'company_id',
- ),
- 'request' => array
- (
- 'list_option' => array
- (
- 'col' => 'yes-follow_admin_id,follow_group_id',
- 'type' => array('yes', 'in'),
- 'state' =>1,
- ),
- 'list' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'area' => array('yes','like'),
- 'name' => array('yes','like'),
- 'mobile' => 'yes',
- 'source' => 'yes',
- 'userset_id' => 'yes',
- 'type' => 'yes',
- 'out_type' =>'yes',
- 'start_cdate'=>array('yes-cdate','>='),
- 'end_cdate' => array('yes-cdate','<='),
- 'follow_admin_id' => 'yes',
- 'follow_group_id' => 'yes',
- // 'area' => array('yes', 'like'),
- 'start_day' => array('yes-day', '>='),
- 'end_day' => array('yes-day', '<='),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('cdate' => 'desc'),
- 'page' => array(20, 'list'),
- // 'group' => 'shop_id',
- 'col' => '*',
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-cdate','>='),
- 'end'=>array('yes-cdate','<='),
- 'follow_group_id' =>'yes',
- 'create_group_id' => 'yes',
- // 'type' =>array('yes','in'),
- 'state' => 1,
- ),
- 'type' => 'all',
- // 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- // 'page' => array(5,'list'),
- 'col' => '*|follow_admin_id',
- ),
- 'getHAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-cdate','>='),
- 'end'=>array('yes-cdate','<='),
- 'follow_group_id' =>'yes',
- 'gstart' => array('yes-gdate','>='),
- 'gend' => array('yes-gdate','<='),
- 'fstart' => array('yes-fdate','>='),
- 'fend' => array('yes-fdate','<='),
- 'type' =>array('yes','in'),
- 'state' => 1,
- ),
- 'type' => 'count',
- // 'order' => array('reorder' => 'desc', 'id' => 'desc'),
- // 'page' => array(5,'list'),
- 'col' => '*',
- ),
- ),
- );
|