Commit a63c6cb9 by html5-李恒逸

修改报备客户重复bug

parent b0f63adb
......@@ -119,7 +119,8 @@ class Report extends CI_Controller
$this->data['count'] = $count;
$customers = $this->customer_building->get_report_list($where, $page_no, self::PAGE_SIZE);
// echo '<pre>';
// print_r($customers);die;
if ($customers) {
//查找楼盘的经理和销售员关系
......@@ -488,7 +489,7 @@ class Report extends CI_Controller
if($customerId){
foreach ($customerId as $value) {
$results = $api->newgetCustomerVisit(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']);
......@@ -558,7 +559,7 @@ class Report extends CI_Controller
if($customerId){
foreach ($customerId as $value) {
$results = $api->newgetCustomerPurchase(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息
......@@ -626,7 +627,7 @@ class Report extends CI_Controller
if($customerId){
foreach ($customerId as $value) {
$results = $api->newgetCustomerSign(array('customer_id'=>$value['rongchuang_id']));
if(!empty($results)){
$entity_id = $this->customer_building->get_building_id($value['id']);
//记录客户跟进信息
......
......@@ -137,7 +137,8 @@ class Customer_building_model extends MY_Model{
//客户报备列表
public function get_report_list($where = '', $page = 1, $page_size = 10, $order = NULL)
{
$this->db->select('D.company_name,CB.customer_id,C.customer_user,C.customer_mobile,C.customer_idcard,CB.create_time,CB.is_valid,CB.remark,CB.id,CB.assign_time,CB.building_id,C.customer_type,CB.recommend_status,UP.user_name sale_name,UP.true_name Strue_name,TU.true_name Mtrue_name,TU.user_name manager_name,B.building_title,U.user_name agent_name,CB.report_status,CB.report_time,TM.manager_name channel_name')
$this->db->distinct()
->select('D.company_name,CB.customer_id,C.customer_user,C.customer_mobile,C.customer_idcard,CB.create_time,CB.is_valid,CB.remark,CB.id,CB.assign_time,CB.building_id,C.customer_type,CB.recommend_status,UP.user_name sale_name,UP.true_name Strue_name,TU.true_name Mtrue_name,TU.user_name manager_name,B.building_title,U.user_name agent_name,CB.report_status,CB.report_time,TM.manager_name channel_name')
->from('tb_customer_building CB')
->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left')
......
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