diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 61106e3e..2578c21e 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -29,6 +29,8 @@ class Clues extends HD_Controller $this->load->model('app/paic/app_paic_users_model'); $this->load->model('receiver/receiver_enroll_model'); + $this->load->model('biz/biz_car_brand_model'); + $this->log_dir = 'receiver_clues'; } @@ -74,6 +76,7 @@ class Clues extends HD_Controller $this->data['maintainAry'] = $this->maintainAry; $this->data['export_button'] = $export_button; $this->data['role'] = $this->role; + $this->data['levelList'] = $this->customers_model->get_sdata('level'); $this->data['_title'] = '线索池列表'; return $this->show_view('receiver/clues/lists', true); } @@ -159,6 +162,9 @@ class Clues extends HD_Controller !$params['brand_id'] && $params['brand_id'] = 0; !$params['series_id'] && $params['series_id'] = 0; !strlen($params['admin_id']) && $params['admin_id'] = ''; + if ($params['level']) { + $where["id in (select rid from lc_receiver_customers where `level` = '{$params['level']}')"] = null; + } $count = $this->clues_model->count($where); $lists = []; @@ -1296,6 +1302,8 @@ class Clues extends HD_Controller continue; } $biz = $this->biz_model->get(array('id' => $item['biz_id'])); + //获取一条门店品牌 + $bizBrand = $this->biz_car_brand_model->get(['biz_id' => $biz['id']]); $add = array( 'rid' => $re['id'], 'cid' => create_customer_no($biz['county_id']), @@ -1320,6 +1328,15 @@ class Clues extends HD_Controller if ($re['app_id'] == Receiver_clues_model::APP_ID_ACTIVITY) { $add['un_lock'] = Receiver_customers_model::UNLOCK_STATUS; } + //获取用户留资记录与门店品牌对应数据 + if ($bizBrand) { + $where = ['mobile' => $re['mobile'], 'brand_id' => $bizBrand['brand_id']]; + $enrollRows = $this->receiver_enroll_model->select($where, 'id desc', 1, 1); + if ($enrollRows) { + $add['brand_id'] = $enrollRows[0]['brand_id']; + $add['series_id'] = $enrollRows[0]['series_id']; + } + } $customers_id = $this->customers_model->add($add); if (!$customers_id) { continue; diff --git a/admin/views/receiver/clues/lists.php b/admin/views/receiver/clues/lists.php index 92828d12..ddcc94aa 100644 --- a/admin/views/receiver/clues/lists.php +++ b/admin/views/receiver/clues/lists.php @@ -92,6 +92,15 @@ +
+ +
+ +
+
@@ -290,7 +299,7 @@ - +

- + 分配时间:
@@ -375,6 +384,8 @@ export_button: , admin_id: , adminAry: , + levelList: , + level: "", }, mounted: function () { this.init_provinces(); diff --git a/agent/admin/controllers/pingan/receiver/Clues.php b/agent/admin/controllers/pingan/receiver/Clues.php index 7c406252..6b4d9dfa 100644 --- a/agent/admin/controllers/pingan/receiver/Clues.php +++ b/agent/admin/controllers/pingan/receiver/Clues.php @@ -405,7 +405,7 @@ class Clues extends BaseController $status_name = $statusAry[$v['status']]['name']; $v['status2'] && $status_name .= '‒' . $statusAry[$v['status']]['list'][$v['status2']]; if ($limit >= 10000) { - $unLockReason = $is_unlock = ''; + $levelName = $unLockReason = $is_unlock = ''; if ($v['status'] == 1) { $unlockCustomer = $this->customers_model->get(['rid' => $v['id'], 'un_lock' => Receiver_customers_model::LOCK_STATUS]); $is_unlock = $unlockCustomer ? '已解锁' : '未解锁'; @@ -415,6 +415,7 @@ class Clues extends BaseController preg_match_all('/【(.*?)】/', $optLog[0]['log'], $matches); $unLockReason = $matches[1]; } + $levelName = $unlockCustomer['level']; } $temp = [ 'name' => $v['name'], 'mobile' => mobile_asterisk($v['mobile']), 'sid' => $v['sid'], @@ -428,7 +429,8 @@ class Clues extends BaseController 'subStatusCn' => $statusAry[$v['status']]['list'][$v['status2']] ?: '', 'isUnlock' => $is_unlock, 'unLockReason' => $unLockReason, - 'enTime' => $v['en_time'], + 'levelName' => $levelName, + 'enTime' => $v['en_time'] ]; } else { $temp = [ @@ -449,7 +451,7 @@ class Clues extends BaseController } $columns = []; if ($limit >= 10000) { - $columns = ['姓名', '手机号', '订单编号', '归属', '中心', '机构', '关注车型', '所属省', '所属市', '主状态', '子状态', '是否解锁', '未解锁原因', '入池时间']; + $columns = ['姓名', '手机号', '订单编号', '归属', '中心', '机构', '关注车型', '所属省', '所属市', '主状态', '子状态', '是否解锁', '未解锁原因', '客户等级', '入池时间']; } return ['list' => $list, 'count' => $count, 'statusList' => $statusList, 'columns' => $columns]; }