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 @@ +