diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index b195b23d..75e4264a 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -50,8 +50,9 @@ class Customer extends HD_Controller $lists = []; $offlineSources = $this->customers_model->offlineSources(); $wxqyAry = $this->customers_model->wxqyAry(); + $wxgrAry = $this->customers_model->wxgrAry(); if ($count) { - $fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,cs_biz_id,level,of_id,of2_id,wxqy'; + $fileds = 'id,name,mobile,cf_title,cont_time,admin_id,status,biz_id,cs_biz_id,level,of_id,of2_id,wxqy,wxgr'; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); //获取销售员 $admin_id_arr = array_unique(array_column($rows, 'admin_id')); @@ -81,6 +82,7 @@ class Customer extends HD_Controller 'of2_id' => $val['of2_id'], 'status_name' => $status_arr[$val['status']], 'wxqy_name' => $wxqyAry[$val['wxqy']], + 'wxgr_name' => $wxgrAry[$val['wxgr']], 'to_send' => $this->customers_model->csbizidAry($val['cs_biz_id'] ? $val['cs_biz_id'] : 0), 'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '', 'biz_name' => isset($biz_rows[$val['biz_id']]) ? $biz_rows[$val['biz_id']][0]['biz_name'] : '', @@ -96,6 +98,7 @@ class Customer extends HD_Controller #$show_info['offlineSourcesAry'] = $offlineSources; $show_info['offlineSourcesAry'] = $this->customers_model->offlineSources_search(); $show_info['wxqyAry'] = $wxqyAry; + $show_info['wxgrAry'] = $wxgrAry; $show_info['csbizidAry'] = $this->customers_model->csbizidAry(); $this->data['show_info'] = $show_info; $this->data['lists'] = $lists; @@ -152,6 +155,11 @@ class Customer extends HD_Controller } else { $params['wxqy'] = ''; } + if (strlen($params['wxgr'])) { + $where["wxgr"] = $params['wxgr']; + } else { + $params['wxgr'] = ''; + } !$params['search_tp'] && $params['search_tp'] = 'mobile'; strlen($params['status']) && $where["status"] = $params['status']; if ($params['qdjl_id']) { @@ -325,6 +333,8 @@ class Customer extends HD_Controller 'mobile' => $mobile_sub, 'of_title' => $of_title, 'wxqy_name' => $this->customers_model->wxqyAry($row['wxqy']), + 'wxgr_name' => $this->customers_model->wxgrAry($row['wxgr']), + 'wx_name' => '企微:'.$this->customers_model->wxqyAry($row['wxqy']).'; 个微:'.$this->customers_model->wxgrAry($row['wxgr']), 'cf_user' => $cf_user, 'to_send' => $to_send, 'c_time' => date('Y-m-d H:i:s', $row['c_time']), @@ -575,7 +585,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"; + $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"; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); foreach ($rows as $key => $val) { $of_title = ''; @@ -603,6 +613,8 @@ class Customer extends HD_Controller 'of_title_2' => $of_title_2, 'biz_name' => $val['biz_name'], 'admin_name' => $val['admin_name'], + 'wxqy_name' => $this->customers_model->wxqyAry($val['wxqy']), + 'wxgr_name' => $this->customers_model->wxgrAry($val['wxgr']), ); } } @@ -621,6 +633,8 @@ class Customer extends HD_Controller "of_title_2" => "来源2", "biz_name" => "归属门店", "admin_name" => "归属顾问", + "wxqy_name" => "企微好友", + "wxgr_name" => "加个微", ]; $fileName = '客户列表'; array_unshift($data, $indexs); diff --git a/admin/views/receiver/customer/get.php b/admin/views/receiver/customer/get.php index a44fd0c7..6cfa7033 100644 --- a/admin/views/receiver/customer/get.php +++ b/admin/views/receiver/customer/get.php @@ -59,7 +59,7 @@