diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index 5d2c5920..e09a10f7 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -80,7 +80,7 @@ class Common extends CI_Controller if ($url == 'search') { $province = $this->filter($this->area_model->province()); } else { - $province_limit = $province_limit ? true :false; + $province_limit = $province_limit ? true : false; $province = $this->area_model->province($province_limit); } $this->data = $province; @@ -1161,11 +1161,12 @@ class Common extends CI_Controller return $this->show_json(SYS_CODE_SUCCESS); } - public function auto_search(){ + public function auto_search() + { $name = $this->input->get('name'); $lists = []; - if($name){ + if ($name) { $where = array( "name like '%{$name}%'" => null, "status" => 1 @@ -1183,4 +1184,15 @@ class Common extends CI_Controller $this->data = $lists; return $this->show_json(SYS_CODE_SUCCESS); } + + public function get_paic_users() + { + $this->load->model('app/paic/app_paic_users_model'); + $where = [ + 'status' => App_paic_users_model::STATUS_NORMAL + ]; + $rows = $this->app_paic_users_model->select($where, 'id desc', 0, 0, 'id,name'); + $this->data = $rows; + return $this->show_json(SYS_CODE_SUCCESS); + } } diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 76564009..86d7bac7 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -26,6 +26,7 @@ class Clues extends HD_Controller $this->load->model('area_model'); $this->load->model('auto/auto_brand_model'); $this->load->model('auto/auto_series_model'); + $this->load->model('app/paic/app_paic_users_model'); $this->log_dir = 'receiver_clues'; } @@ -414,7 +415,7 @@ class Clues extends HD_Controller $this->data['action'] = $action; $this->data['_title'] = $title; - return $this->show_view('receiver/clues/get'); + return $this->show_view('receiver/clues/get',true); } //添加单条数据 @@ -458,6 +459,7 @@ class Clues extends HD_Controller $info['biz_id'] && $add['status'] = 1; $info['biz_id'] && $add['status2'] = 1; $info['biz_id'] && $add['p_time'] = date('Y-m-d H:i:s'); + $info['cf_pid'] && $add['cf_pid'] = $info['cf_pid']; $ret = $this->clues_model->add($add); if ($ret) { $log = '新增线索'; @@ -495,6 +497,7 @@ class Clues extends HD_Controller $info['province_id'] && $add['province_id'] = $info['province_id']; $info['city_id'] && $add['city_id'] = $info['city_id']; $info['county_id'] && $add['county_id'] = $info['county_id']; + $info['cf_pid'] && $add['cf_pid'] = $info['cf_pid']; $customers_id = $this->customers_model->add($add); if ($customers_id) { @@ -675,7 +678,9 @@ class Clues extends HD_Controller $up['brand_id'] = $info['brand_id']; $up['series_id'] = $info['series_id']; } - + if ($info['cf_pid'] != $re['cf_pid']) { + $up['cf_pid'] = $info['cf_pid']; + } $ret = $this->clues_model->update($up, array('id' => $info['id'])); if (!$ret) { @@ -738,6 +743,7 @@ class Clues extends HD_Controller 'series_id' => $re['series_id'], 'p_time' => $re['p_time'], 'cont_time' => $re['cont_time'], + 'cf_pid' => $re['cf_pid'], 'c_time' => $re['c_time'], ); @@ -927,7 +933,8 @@ class Clues extends HD_Controller 'of2_id' => 37, 'cf_id' => $clues_row['cf_id'], 'p_time' => date('Y-m-d H:i:s'), - 'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time']) + 'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time']), + 'cf_pid' => $clues_row['cf_pid'], ]; $customers_id = $this->customers_model->add($add_data); if ($customers_id) { diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 4f94e07e..7b26c451 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -30,6 +30,7 @@ class Customer extends HD_Controller $this->load->model('area_model'); $this->load->model('auto/auto_brand_model'); $this->load->model('auto/auto_series_model'); + $this->load->model('app/paic/app_paic_users_model'); $this->log_dir = 'receiver_' . get_class($this); } @@ -631,6 +632,10 @@ class Customer extends HD_Controller $series = $this->auto_series_model->get(['id' => $row['series_id']]); $series && $brand_detail .= '-' . $series['name']; } + $paic_user = ''; + if ($row['cf_pid']) { + $paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]); + } $info = array( 'id' => $row['id'], 'name' => $row['name'], @@ -648,7 +653,8 @@ class Customer extends HD_Controller 'biz' => $row_biz['biz_name'], 'time_name' => $row['clue_id'] ? '派单时间' : '建档时间', 'brand_detail' => $brand_detail, - 'role' => $this->role + 'role' => $this->role, + 'cf_name' => $paic_user ? $paic_user['name'] : '' ); //到店信息 diff --git a/admin/views/index.php b/admin/views/index.php index be7f4587..c19774a2 100644 --- a/admin/views/index.php +++ b/admin/views/index.php @@ -37,6 +37,8 @@ + +
diff --git a/admin/views/receiver/clues/edit.php b/admin/views/receiver/clues/edit.php index a68726dc..e9721fd6 100644 --- a/admin/views/receiver/clues/edit.php +++ b/admin/views/receiver/clues/edit.php @@ -1,3 +1,11 @@ + +