Commit cd56aa5a by HTML5-侯张振

屏蔽接口

parent 63fc0d24
...@@ -286,7 +286,7 @@ class Report extends CI_Controller ...@@ -286,7 +286,7 @@ class Report extends CI_Controller
$query_sql = "SELECT IFNULL(manager_id,0) as manager_id FROM tb_sales_building WHERE `building_id` = $building_id AND is_deleted = 0 GROUP BY manager_id"; $query_sql = "SELECT IFNULL(manager_id,0) as manager_id FROM tb_sales_building WHERE `building_id` = $building_id AND is_deleted = 0 GROUP BY manager_id";
$building_managers = $this->sales_building->get_all_manager_by_sql($query_sql); $building_managers = $this->sales_building->get_all_manager_by_sql($query_sql);
$string = ''; $string = '';
if(empty($building_managers)){ if(empty($building_managers)){
...@@ -473,15 +473,15 @@ class Report extends CI_Controller ...@@ -473,15 +473,15 @@ class Report extends CI_Controller
$time=date("Y-m-d",$t); $time=date("Y-m-d",$t);
//分配给销售 //分配给销售
if ($post['userType'] == 'sale') { // if ($post['userType'] == 'sale') {
$newcustomerId = $api->newimportCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title'],$newcustomerInfo['rongchuang_id'],$newcustomerInfo['user_mobile'],$time); // $newcustomerId = $api->newimportCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title'],$newcustomerInfo['rongchuang_id'],$newcustomerInfo['user_mobile'],$time);
//分配给销售经理 // //分配给销售经理
} else if ($post['userType'] == 'manager'){ // } else if ($post['userType'] == 'manager'){
$newcustomerId = $api->importCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title']); // $newcustomerId = $api->importCustomer($newcustomerInfo['customer_user'], $newcustomerInfo['customer_mobile'], $newcustomerInfo['buildingId'], $newcustomerInfo['building_title']);
} // }
$newcustomer = array( // $newcustomer = array(
'rongchuang_id' => $newcustomerId // 'rongchuang_id' => $newcustomerId
); // );
if($newcustomerId){ if($newcustomerId){
$this->customer->add_rongchuang_id($newcustomerInfo['customerId'],$newcustomer); $this->customer->add_rongchuang_id($newcustomerInfo['customerId'],$newcustomer);
...@@ -504,255 +504,255 @@ class Report extends CI_Controller ...@@ -504,255 +504,255 @@ class Report extends CI_Controller
echo json_encode($result);exit; echo json_encode($result);exit;
} }
//正式 //正式
//记录客户到访在后台自执行 // //记录客户到访在后台自执行
public function dnCustomerVisit(){ // public function dnCustomerVisit(){
$this->load->model('customer_model','customer'); // $this->load->model('customer_model','customer');
$this->load->model('customer_building_model', 'customer_building'); // $this->load->model('customer_building_model', 'customer_building');
$this->load->model('recommend_trace_model', 'recommend'); // $this->load->model('recommend_trace_model', 'recommend');
$this->load->model('customer_building_log_model','customer_building_log'); // $this->load->model('customer_building_log_model','customer_building_log');
$this->load->model('sales_model','sales'); // $this->load->model('sales_model','sales');
$this->load->model('customer_sales_model','customer_sales'); // $this->load->model('customer_sales_model','customer_sales');
$this->load->helper('eas'); // $this->load->helper('eas');
$api=new easApi; // $api=new easApi;
$customerId = $this->customer->search_rongchuang_id(); // $customerId = $this->customer->search_rongchuang_id();
if($customerId){ // if($customerId){
foreach ($customerId as $value) { // foreach ($customerId as $value) {
//获取接口返回值 // //获取接口返回值
$results = $api->newgetCustomerVisit(array('customer_id'=>$value['rongchuang_id'])); // $results = $api->newgetCustomerVisit(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){ // if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']); // $entity_id = $this->customer_building->get_building_id($value['id']);
//
$customerBuilding = $this->customer_building->get(array('id' => $entity_id['id'])); // $customerBuilding = $this->customer_building->get(array('id' => $entity_id['id']));
//获取返回的sale_id // //获取返回的sale_id
$checksalesnum=array(); // $checksalesnum=array();
$checksales=$results[0]["saleManColl"]; // $checksales=$results[0]["saleManColl"];
foreach($checksales as $checksale){ // foreach($checksales as $checksale){
$checksalesID=$this->sales->get(array('rongchuang_user_id'=> $checksale["id"])); // $checksalesID=$this->sales->get(array('rongchuang_user_id'=> $checksale["id"]));
$checksalesnum[]=array('sale_id'=>$checksalesID['user_id']); // $checksalesnum[]=array('sale_id'=>$checksalesID['user_id']);
}; // };
$customer_sales_id = $this->customer_building->get_sale_id(array('customer_building_id'=>$customerBuilding['id'])); // $customer_sales_id = $this->customer_building->get_sale_id(array('customer_building_id'=>$customerBuilding['id']));
if(!($customer_sales_id==$checksalesnum)){ // if(!($customer_sales_id==$checksalesnum)){
$this->customer_sales->delete_sale_id(array('customer_building_id'=>$customerBuilding['id'])); // $this->customer_sales->delete_sale_id(array('customer_building_id'=>$customerBuilding['id']));
foreach($checksalesnum as $checksales){ // foreach($checksalesnum as $checksales){
//
$customersales['customer_building_id'] = $customerBuilding['id']; // $customersales['customer_building_id'] = $customerBuilding['id'];
$customersales['sale_id'] = $checksales['sale_id']; // $customersales['sale_id'] = $checksales['sale_id'];
$customersales['create_time'] = time(); // $customersales['create_time'] = time();
$this->customer_sales->add_sale_id($customersales); // $this->customer_sales->add_sale_id($customersales);
} // }
$datasales['user_id'] = $customerBuilding['user_id']; // $datasales['user_id'] = $customerBuilding['user_id'];
$datasales['customer_id'] = $customerBuilding['customer_id']; // $datasales['customer_id'] = $customerBuilding['customer_id'];
$datasales['building_id'] = $customerBuilding['building_id']; // $datasales['building_id'] = $customerBuilding['building_id'];
$datasales['distributor_id'] = $customerBuilding['distributor_id']; // $datasales['distributor_id'] = $customerBuilding['distributor_id'];
$datasales['building_title'] = $customerBuilding['building_title']; // $datasales['building_title'] = $customerBuilding['building_title'];
$datasales['sale_id'] = $customerBuilding['sale_id']; // $datasales['sale_id'] = $customerBuilding['sale_id'];
$datasales['manager_id'] = $customerBuilding['manager_id']; // $datasales['manager_id'] = $customerBuilding['manager_id'];
$datasales['distribution_status'] = $customerBuilding['distribution_status']; // $datasales['distribution_status'] = $customerBuilding['distribution_status'];
$datasales['recommend_status'] = $customerBuilding['recommend_status']; // $datasales['recommend_status'] = $customerBuilding['recommend_status'];
$datasales['is_deleted'] = $customerBuilding['is_deleted']; // $datasales['is_deleted'] = $customerBuilding['is_deleted'];
$datasales['create_time'] = $customerBuilding['create_time']; // $datasales['create_time'] = $customerBuilding['create_time'];
$datasales['action_time'] = time(); // $datasales['action_time'] = time();
if($customerBuilding['sale_id']==0){ // if($customerBuilding['sale_id']==0){
$datasales['remark'] = '分配'; // $datasales['remark'] = '分配';
}else{ // }else{
$datasales['remark'] = '重新分配'; // $datasales['remark'] = '重新分配';
} // }
$this->customer_building_log->add($datasales); // $this->customer_building_log->add($datasales);
} // }
if($customerBuilding['recommend_status'] < 2){ // if($customerBuilding['recommend_status'] < 2){
$this->customer_building->update_customer_building($value['id'],array('recommend_status' => 2)); // $this->customer_building->update_customer_building($value['id'],array('recommend_status' => 2));
$customerBuilding['recommend_status']=2; // $customerBuilding['recommend_status']=2;
} // }
//记录客户跟进信息 // //记录客户跟进信息
if ($customerBuilding) { // if ($customerBuilding) {
$dataLog['user_id'] = $customerBuilding['user_id']; // $dataLog['user_id'] = $customerBuilding['user_id'];
$dataLog['customer_id'] = $customerBuilding['customer_id']; // $dataLog['customer_id'] = $customerBuilding['customer_id'];
$dataLog['building_id'] = $customerBuilding['building_id']; // $dataLog['building_id'] = $customerBuilding['building_id'];
$dataLog['distributor_id'] = $customerBuilding['distributor_id']; // $dataLog['distributor_id'] = $customerBuilding['distributor_id'];
$dataLog['building_title'] = $customerBuilding['building_title']; // $dataLog['building_title'] = $customerBuilding['building_title'];
$dataLog['sale_id'] = $customerBuilding['sale_id']; // $dataLog['sale_id'] = $customerBuilding['sale_id'];
$dataLog['manager_id'] = $customerBuilding['manager_id']; // $dataLog['manager_id'] = $customerBuilding['manager_id'];
$dataLog['distribution_status'] = $customerBuilding['distribution_status']; // $dataLog['distribution_status'] = $customerBuilding['distribution_status'];
$dataLog['recommend_status'] = $customerBuilding['recommend_status']; // $dataLog['recommend_status'] = $customerBuilding['recommend_status'];
$dataLog['is_deleted'] = $customerBuilding['is_deleted']; // $dataLog['is_deleted'] = $customerBuilding['is_deleted'];
$dataLog['create_time'] = $customerBuilding['create_time']; // $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); // $dataLog['action_time'] = time();
$dataLog['remark'] = '客户到访'; // $dataLog['remark'] = '客户到访';
//
} // }
$parme = array( // $parme = array(
'entity_type' => '1', // 'entity_type' => '1',
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '2', // 'trace_status' => '2',
'create_time' => time() // 'create_time' => time()
); // );
//防止重复记录log // //防止重复记录log
$log_screening = array( // $log_screening = array(
'customer_id' => $customerBuilding['customer_id'], // 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '2' // 'recommend_status' => '2'
); // );
//
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); // $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
//
if(empty($logfahui)){ // if(empty($logfahui)){
$this->customer_building_log->add($dataLog); // $this->customer_building_log->add($dataLog);
} // }
////防止重复报备recommend_trace // ////防止重复报备recommend_trace
$screening = array( // $screening = array(
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '2' // 'trace_status' => '2'
); // );
//
$screeningfahui = $this->recommend->screening_recommend_status($screening); // $screeningfahui = $this->recommend->screening_recommend_status($screening);
//
if(empty($screeningfahui)){ // if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); // $this->recommend->add_recommend_trace($parme);
} // }
} // }
}; // };
//
} // }
} // }
//记录客户认购在后台自执行 // //记录客户认购在后台自执行
public function dnPurchase(){ // public function dnPurchase(){
$this->load->model('customer_model','customer'); // $this->load->model('customer_model','customer');
$this->load->model('customer_building_model', 'customer_building'); // $this->load->model('customer_building_model', 'customer_building');
$this->load->model('recommend_trace_model', 'recommend'); // $this->load->model('recommend_trace_model', 'recommend');
$this->load->model('customer_building_log_model','customer_building_log'); // $this->load->model('customer_building_log_model','customer_building_log');
$this->load->helper('eas'); // $this->load->helper('eas');
$api=new easApi; // $api=new easApi;
$customerId = $this->customer->search_rongchuang_id(); // $customerId = $this->customer->search_rongchuang_id();
if($customerId){ // if($customerId){
foreach ($customerId as $value) { // foreach ($customerId as $value) {
//获取返回值 // //获取返回值
$results = $api->newgetCustomerPurchase(array('customer_id'=>$value['rongchuang_id'])); // $results = $api->newgetCustomerPurchase(array('customer_id'=>$value['rongchuang_id']));
//
if(!empty($results)){ // if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']); // $entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息 // //记录客户跟进信息
$customerBuilding = $this->customer_building->get(array('id' => $entity_id['id'])); // $customerBuilding = $this->customer_building->get(array('id' => $entity_id['id']));
if($customerBuilding['recommend_status'] < 3){ // if($customerBuilding['recommend_status'] < 3){
$this->customer_building->update_customer_building($value['id'],array('recommend_status' => 3)); // $this->customer_building->update_customer_building($value['id'],array('recommend_status' => 3));
$customerBuilding['recommend_status']=3; // $customerBuilding['recommend_status']=3;
} // }
if ($customerBuilding) { // if ($customerBuilding) {
$dataLog['user_id'] = $customerBuilding['user_id']; // $dataLog['user_id'] = $customerBuilding['user_id'];
$dataLog['customer_id'] = $customerBuilding['customer_id']; // $dataLog['customer_id'] = $customerBuilding['customer_id'];
$dataLog['building_id'] = $customerBuilding['building_id']; // $dataLog['building_id'] = $customerBuilding['building_id'];
$dataLog['distributor_id'] = $customerBuilding['distributor_id']; // $dataLog['distributor_id'] = $customerBuilding['distributor_id'];
$dataLog['building_title'] = $customerBuilding['building_title']; // $dataLog['building_title'] = $customerBuilding['building_title'];
$dataLog['sale_id'] = $customerBuilding['sale_id']; // $dataLog['sale_id'] = $customerBuilding['sale_id'];
$dataLog['manager_id'] = $customerBuilding['manager_id']; // $dataLog['manager_id'] = $customerBuilding['manager_id'];
$dataLog['distribution_status'] = $customerBuilding['distribution_status']; // $dataLog['distribution_status'] = $customerBuilding['distribution_status'];
$dataLog['recommend_status'] = $customerBuilding['recommend_status']; // $dataLog['recommend_status'] = $customerBuilding['recommend_status'];
$dataLog['is_deleted'] = $customerBuilding['is_deleted']; // $dataLog['is_deleted'] = $customerBuilding['is_deleted'];
$dataLog['create_time'] = $customerBuilding['create_time']; // $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); // $dataLog['action_time'] = time();
$dataLog['remark'] = '客户认购'; // $dataLog['remark'] = '客户认购';
//
} // }
$parme = array( // $parme = array(
'entity_type' => '1', // 'entity_type' => '1',
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '3', // 'trace_status' => '3',
'create_time' => time() // 'create_time' => time()
); // );
//防止重复报备log // //防止重复报备log
$log_screening = array( // $log_screening = array(
'customer_id' => $customerBuilding['customer_id'], // 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '3' // 'recommend_status' => '3'
); // );
//
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); // $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
//
if(empty($logfahui)){ // if(empty($logfahui)){
$this->customer_building_log->add($dataLog); // $this->customer_building_log->add($dataLog);
} // }
//防止重复报备recommend_trace // //防止重复报备recommend_trace
$screening = array( // $screening = array(
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '3' // 'trace_status' => '3'
); // );
//
$screeningfahui = $this->recommend->screening_recommend_status($screening); // $screeningfahui = $this->recommend->screening_recommend_status($screening);
//
if(empty($screeningfahui)){ // if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); // $this->recommend->add_recommend_trace($parme);
} // }
} // }
}; // };
} // }
} // }
//记录客户签约在后台自执行 // //记录客户签约在后台自执行
public function dnSign(){ // public function dnSign(){
$this->load->model('customer_model','customer'); // $this->load->model('customer_model','customer');
$this->load->model('customer_building_model', 'customer_building'); // $this->load->model('customer_building_model', 'customer_building');
$this->load->model('recommend_trace_model', 'recommend'); // $this->load->model('recommend_trace_model', 'recommend');
$this->load->model('customer_building_log_model','customer_building_log'); // $this->load->model('customer_building_log_model','customer_building_log');
$this->load->helper('eas'); // $this->load->helper('eas');
$api=new easApi; // $api=new easApi;
$customerId = $this->customer->search_rongchuang_id(); // $customerId = $this->customer->search_rongchuang_id();
if($customerId){ // if($customerId){
foreach ($customerId as $value) { // foreach ($customerId as $value) {
$results = $api->newgetCustomerSign(array('customer_id'=>$value['rongchuang_id'])); // $results = $api->newgetCustomerSign(array('customer_id'=>$value['rongchuang_id']));
//
if(!empty($results)){ // if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']); // $entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息 // //记录客户跟进信息
$customerBuilding = $this->customer_building->get(array('id' => $entity_id['id'])); // $customerBuilding = $this->customer_building->get(array('id' => $entity_id['id']));
if($customerBuilding['recommend_status'] < 4){ // if($customerBuilding['recommend_status'] < 4){
$this->customer_building->update_customer_building($value['id'],array('recommend_status' => 4)); // $this->customer_building->update_customer_building($value['id'],array('recommend_status' => 4));
$customerBuilding['recommend_status']=4; // $customerBuilding['recommend_status']=4;
} // }
if ($customerBuilding) { // if ($customerBuilding) {
$dataLog['user_id'] = $customerBuilding['user_id']; // $dataLog['user_id'] = $customerBuilding['user_id'];
$dataLog['customer_id'] = $customerBuilding['customer_id']; // $dataLog['customer_id'] = $customerBuilding['customer_id'];
$dataLog['building_id'] = $customerBuilding['building_id']; // $dataLog['building_id'] = $customerBuilding['building_id'];
$dataLog['distributor_id'] = $customerBuilding['distributor_id']; // $dataLog['distributor_id'] = $customerBuilding['distributor_id'];
$dataLog['building_title'] = $customerBuilding['building_title']; // $dataLog['building_title'] = $customerBuilding['building_title'];
$dataLog['sale_id'] = $customerBuilding['sale_id']; // $dataLog['sale_id'] = $customerBuilding['sale_id'];
$dataLog['manager_id'] = $customerBuilding['manager_id']; // $dataLog['manager_id'] = $customerBuilding['manager_id'];
$dataLog['distribution_status'] = $customerBuilding['distribution_status']; // $dataLog['distribution_status'] = $customerBuilding['distribution_status'];
$dataLog['recommend_status'] = $customerBuilding['recommend_status']; // $dataLog['recommend_status'] = $customerBuilding['recommend_status'];
$dataLog['is_deleted'] = $customerBuilding['is_deleted']; // $dataLog['is_deleted'] = $customerBuilding['is_deleted'];
$dataLog['create_time'] = $customerBuilding['create_time']; // $dataLog['create_time'] = $customerBuilding['create_time'];
$dataLog['action_time'] = time(); // $dataLog['action_time'] = time();
$dataLog['remark'] = '客户签约'; // $dataLog['remark'] = '客户签约';
//
} // }
$parme = array( // $parme = array(
'entity_type' => '1', // 'entity_type' => '1',
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '4', // 'trace_status' => '4',
'create_time' => time() // 'create_time' => time()
); // );
//
//防止重复报备log // //防止重复报备log
$log_screening = array( // $log_screening = array(
'customer_id' => $customerBuilding['customer_id'], // 'customer_id' => $customerBuilding['customer_id'],
'recommend_status' => '4' // 'recommend_status' => '4'
); // );
//
$logfahui = $this->customer_building_log->screening_recommend_status($log_screening); // $logfahui = $this->customer_building_log->screening_recommend_status($log_screening);
//
if(empty($logfahui)){ // if(empty($logfahui)){
$this->customer_building_log->add($dataLog); // $this->customer_building_log->add($dataLog);
} // }
////防止重复报备recommend_trace // ////防止重复报备recommend_trace
$screening = array( // $screening = array(
'entity_id' => $entity_id['id'], // 'entity_id' => $entity_id['id'],
'trace_status' => '4' // 'trace_status' => '4'
); // );
//
$screeningfahui = $this->recommend->screening_recommend_status($screening); // $screeningfahui = $this->recommend->screening_recommend_status($screening);
//
if(empty($screeningfahui)){ // if(empty($screeningfahui)){
$this->recommend->add_recommend_trace($parme); // $this->recommend->add_recommend_trace($parme);
} // }
} // }
}; // };
} // }
} // }
/** /**
...@@ -1326,7 +1326,7 @@ class Report extends CI_Controller ...@@ -1326,7 +1326,7 @@ class Report extends CI_Controller
$customers = $this->customer_building->get_reportagain_list($where, $page_no, self::PAGE_SIZE); $customers = $this->customer_building->get_reportagain_list($where, $page_no, self::PAGE_SIZE);
$this->data['customers'] = $customers; $this->data['customers'] = $customers;
//echo '<pre>';print_r($customers);die; //echo '<pre>';print_r($customers);die;
$data_arr = '?' . http_build_query($con_arr); $data_arr = '?' . http_build_query($con_arr);
...@@ -1334,7 +1334,7 @@ class Report extends CI_Controller ...@@ -1334,7 +1334,7 @@ class Report extends CI_Controller
$this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1; $this->data['num_start'] = ($page_no - 1) * self::PAGE_SIZE + 1;
//获取分页 //获取分页
$this->data['num_link'] = set_page_new($data_arr, $this,site_url('admin/report/index'), $count, self::PAGE_SIZE, 4, '', true); $this->data['num_link'] = set_page_new($data_arr, $this,site_url('admin/report/index'), $count, self::PAGE_SIZE, 4, '', true);
$this->load->view('admin/report/report_again', $this->data); $this->load->view('admin/report/report_again', $this->data);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment