From 5e9280f15050898739bfd5b4396e51a714f26701 Mon Sep 17 00:00:00 2001 From: dengbw Date: Tue, 26 Oct 2021 11:31:59 +0800 Subject: [PATCH] admin_customer_1026 --- admin/controllers/receiver/Customer.php | 14 ++++++++++---- admin/views/receiver/customer/lists.php | 25 +++++++++++++++++++------ api/controllers/plan/Licheb.php | 4 ++-- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index e63fe225..e96013fb 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -40,12 +40,13 @@ class Customer extends HD_Controller !$params['biz_id'] && $params['biz_id'] = ''; !$params['cf_title'] && $params['cf_title'] = ''; !$params['qdjl_id'] && $params['qdjl_id'] = ''; + !$params['level'] && $params['level'] = ''; $page = $params['page'] = $params['page'] ? intval($params['page']) : 1; $size = $params['size'] = $params['size'] ? intval($params['size']) : 20; $where = array('status>=0' => null); - if($_SESSION['admin_info']['biz_id']){ - $biz_ids = implode(',',$_SESSION['admin_info']['biz_id']); + if ($_SESSION['admin_info']['biz_id']) { + $biz_ids = implode(',', $_SESSION['admin_info']['biz_id']); $where["biz_id in ($biz_ids)"] = null; } if (false == strpos($_SERVER['HTTP_HOST'], 'dev')) {//dev时不限制 @@ -54,6 +55,9 @@ class Customer extends HD_Controller if ($params['title']) { $where["{$params['search_tp']} like '%{$params['title']}%'"] = null; } + if ($params['level']) { + $where['level'] = $params['level']; + } !$params['search_tp'] && $params['search_tp'] = 'mobile'; strlen($params['status']) && $where["status"] = $params['status']; $params['cf_title'] && $where['cf_title'] = $params['cf_title']; @@ -160,7 +164,7 @@ class Customer extends HD_Controller $count = $this->customers_model->count($where); $lists = []; if ($count) { - $fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,cf_id'; + $fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,cf_id,level'; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); //获取来源 $cf_id_arr = array_unique(array_column($rows, 'cf_id')); @@ -182,6 +186,7 @@ class Customer extends HD_Controller 'name' => $val['name'], 'mobile' => $val['mobile'], 'mobile_sub' => $mobile_sub, + 'level' => $val['level'], 'cf_title' => $val['cf_title'], 'cf_name' => isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : '', 'status_name' => $status_arr[$val['status']], @@ -193,7 +198,8 @@ class Customer extends HD_Controller } //渠道经理 $qdjl_lists = $this->app_licheb_users_model->select(array('group_id' => 4, 'status' => 1, 'biz_id<>' => '0'), 'id desc', 0, 0, 'id,uname as name'); - + $show_info['levelAry'] = $this->customers_model->get_sdata('level'); + $this->data['show_info'] = $show_info; $this->data['lists'] = $lists; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); $this->data['searchTpAry'] = $this->searchTpAry; diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index 2d701c04..38be556f 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -106,6 +106,15 @@ +
+ +
+ +
+
$value) { ?>
@@ -150,12 +159,13 @@ ID 客户姓名 客户电话 - 来源类型 + 客户等级 + 来源类型 客户来源 - 所属门店 - 状态 - 销售员 - 最后联系时间 + 所属门店 + 状态 + 销售员 + 最后联系时间 @@ -164,6 +174,7 @@ {{v.id}} {{v.name}} {{v.mobile_sub}} + {{v.level}} {{v.cf_title}} {{v.cf_name}} {{v.biz_name}} @@ -172,7 +183,7 @@ {{v.cont_time}} - +
@@ -257,6 +268,7 @@ cfroms: [], cfroms2: [], admins: {cityAry: [], countyAry: [], bizAry: [], list: []}, + show_info: {levelAry: []}, }, mounted: function () { var vm = this; @@ -264,6 +276,7 @@ vm.searchTpAry = ; vm.lists = ; vm.qdjl_lists = ; + vm.show_info = ; this.getCfroms(); vm.init_citys(); }, diff --git a/api/controllers/plan/Licheb.php b/api/controllers/plan/Licheb.php index 96d1f93f..ae5ed0c4 100644 --- a/api/controllers/plan/Licheb.php +++ b/api/controllers/plan/Licheb.php @@ -48,7 +48,7 @@ class Licheb extends HD_Controller $c_id = $redis->get($redisVisit); !$c_id && $c_id = 0; $log = array(); - $where = array('id >' => $c_id, 'status in(0,1)' => null, 'admin_id >' => 0 + $where = array('id >' => $c_id, 'status in(0,1)' => null, 'admin_id >' => 0, 'level <>' => 'D' , 'c_time >=' => strtotime('2021-10-25 00:00:00'), 'c_time <' => strtotime($day . ' 00:00:00')); $res_c = $this->mdCustomers->select($where, 'id asc', 1, $size, 'id,level'); if (!$res_c) { @@ -138,7 +138,7 @@ class Licheb extends HD_Controller $c_id = $redis->get($redisVisit); !$c_id && $c_id = 0; $log = array(); - $where = array('id >' => $c_id, 'status in(0,1)' => null, 'admin_id >' => 0 + $where = array('id >' => $c_id, 'status in(0,1)' => null, 'admin_id >' => 0, 'level <>' => 'D' , 'c_time >=' => strtotime('2021-10-25 00:00:00'), 'c_time <' => strtotime($day . ' 00:00:00')); $res_c = $this->mdCustomers->select($where, 'id asc', 1, $size, 'id,level'); if (!$res_c) {