Commit 2c317b46 by HTML5-侯张振

修复 渠道客户展示bug

parent 546e6444
...@@ -158,10 +158,10 @@ class Index extends CI_Controller{ ...@@ -158,10 +158,10 @@ class Index extends CI_Controller{
else{ else{
$where.='E.id = '.$channel_id; $where.='E.id = '.$channel_id;
} }
//var_dump($this->session->userdata('u_id'));
if($building_id!=''){ $build=$this->manager->get(array('id'=>$this->session->userdata('u_id')));
$where.=' and B.building_id = '.$building_id; //var_dump($build['building_id']);
} $where.=' and B.building_id in ('.$build['building_id'].')';
if($start_time!=''){ if($start_time!=''){
$where.=' and B.create_time >= '.$start_time; $where.=' and B.create_time >= '.$start_time;
} }
...@@ -248,7 +248,7 @@ class Index extends CI_Controller{ ...@@ -248,7 +248,7 @@ class Index extends CI_Controller{
$datestring="%Y-%m-%d"; $datestring="%Y-%m-%d";
$this->load->helper('date'); $this->load->helper('date');
$customer_array = $this->channel->get_all_info($where, $page_no, self::PAGE_SIZE); $customer_array = $this->channel->get_all_info($where, $page_no, self::PAGE_SIZE);
if (is_array($customer_array)) { if (is_array($customer_array)) {
foreach ($customer_array as $i => $cus) { foreach ($customer_array as $i => $cus) {
if (!$lastTime) $lastTime = $cus['create_time']; if (!$lastTime) $lastTime = $cus['create_time'];
...@@ -295,18 +295,47 @@ class Index extends CI_Controller{ ...@@ -295,18 +295,47 @@ class Index extends CI_Controller{
$where=array( $where=array(
'CB.id'=>$cb_id 'CB.id'=>$cb_id
); );
//获取分配时间
$where1 = array(
'RT.entity_id'=>$cb_id,
'RT.trace_status'=>1
);
$this->data['distribution']=$this->recommend_trace->get_create_time($where1);
// var_dump($this->data['distribution']);
// exit;
// 获取到访时间
$where2 = array(
'RT.entity_id'=>$cb_id,
'RT.trace_status'=>2
);
$this->data['visit_time']=$this->recommend_trace->get_create_time($where2);
//获取认购时间
$where3 = array(
'RT.entity_id'=>$cb_id,
'RT.trace_status'=>3
);
$this->data['subscribe']=$this->recommend_trace->get_create_time($where3);
//获取签约时间
$where4 = array(
'RT.entity_id'=>$cb_id,
'RT.trace_status'=>4
);
$this->data['signing']=$this->recommend_trace->get_create_time($where4);
$query=$this->customer_building->get_custormer_channellist_byStatus($where,1,1); $query=$this->customer_building->get_custormer_channellist_byStatus($where,1,1);
if($query[0]['sale_id']!=0){ if($query[0]['sale_id']!=0){
$sales=$this->user->get(array('id'=>$query[0]['sale_id'])); $sales=$this->user->get(array('id'=>$query[0]['sale_id']));
$this->data['sales_name']=$sales['true_name']; $this->data['sales_name']=$sales['true_name'];
$this->data['sales_mobile']=$sales['user_mobile']; $this->data['sales_mobile']=$sales['user_mobile'];
} }
$this->data['feedbacks']=$feedbacks; $this->data['feedbacks']=$feedbacks;
$this->data['entity']=$query; $this->data['entity']=$query;
$this->data['datestring']=$datestring; $this->data['datestring']=$datestring;
$this->data['dateformat']=$dataformat; $this->data['dateformat']=$dataformat;
$this->data['counts']=count($feedbacks); $this->data['counts']=$query[0]['recommend_status'];
$this->load->view('channel/follow',$this->data); $this->load->view('channel/follow',$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