diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 3ab21719..ec869269 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -238,6 +238,8 @@ class Customer extends HD_Controller !$params['level'] && $params['level'] = ''; !$params['of_id'] && $params['of_id'] = ''; !$params['of2_id'] && $params['of2_id'] = ''; + !$params['city_id'] && $params['city_id'] = ''; + !$params['county_id'] && $params['county_id'] = ''; !$params['biz_type'] && $params['biz_type'] = ''; !$params['tags'] && $params['tags'] = ''; !$params['tagsIntention'] && $params['tagsIntention'] = ''; @@ -269,6 +271,12 @@ class Customer extends HD_Controller if ($params['of2_id']) { $where['of2_id'] = $params['of2_id']; } + if ($params['city_id']) { + $where['city_id'] = $params['city_id']; + } + if ($params['county_id']) { + $where['county_id'] = $params['county_id']; + } if (strlen($params['wxqy'])) { $where["wxqy"] = $params['wxqy']; } else { @@ -373,7 +381,8 @@ class Customer extends HD_Controller $id = $this->input->get('id'); $this->load->model('auto/auto_series_model'); $this->load->model('auto/auto_attr_model'); - $row = $this->customers_model->get(array('id' => $id)); + $select = '*, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name'; + $row = $this->customers_model->get(array('id' => $id), $select); if (!$row) { return $this->show_json(SYS_CODE_FAIL, '客户不存在!'); } @@ -455,6 +464,7 @@ class Customer extends HD_Controller 'tag_intention' => $tag_intention, 'tag_group' => $tag_group, 'biz_type' => $biz_type, + 'city_county' => $row['city_name'] ? $row['city_name'].$row['county_name'] : '-', ); //到店信息 @@ -772,6 +782,8 @@ class Customer extends HD_Controller 'mobile' => '手机', 'level' => '客户等级', 'status_name' => '客户状态', + 'city_name' => '所在城市', + 'county_name' => '所在地区', 'to_send' => '是否改派', 'c_time' => '建档时间', "dt_time" => "到店时间", @@ -792,7 +804,7 @@ class Customer extends HD_Controller $status_arr = $this->customers_model->get_status(); unset($status_arr['-1']); if ($count) { - $fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr"; + $fileds = "id, name, mobile, level, status, cs_biz_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, if(order_time>0, order_time,'') as order_time, if(cont_time>0, cont_time,'') as cont_time, cf_title, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name"; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); foreach ($rows as $key => $val) { $of_title = ''; @@ -811,6 +823,8 @@ class Customer extends HD_Controller 'mobile' => $val['mobile'], 'level' => $val['level'], 'status_name' => $status_arr[$val['status']], + 'city_name' => $val['city_name'], + 'county_name' => $val['county_name'], 'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0), 'c_time' => $val['c_time'], 'dt_time' => $val['dt_time'], diff --git a/admin/views/receiver/customer/get.php b/admin/views/receiver/customer/get.php index 155175ed..84ccb2c2 100644 --- a/admin/views/receiver/customer/get.php +++ b/admin/views/receiver/customer/get.php @@ -62,12 +62,19 @@