diff --git a/api/controllers/wechat/Lichene.php b/api/controllers/wechat/Lichene.php index aee9082d..85ac35da 100644 --- a/api/controllers/wechat/Lichene.php +++ b/api/controllers/wechat/Lichene.php @@ -30,9 +30,10 @@ Class Lichene extends HD_Controller */ public function temp() { + $param = $this->input->get(); $this->load->library('wx_qyapi', ['app' => 'lichene']); // $re_wx = $this->wx_qyapi->getSignPackage(); - $re_wx = $this->wx_qyapi->get_external_contact(array('url' => 'user_get', 'userid' => 'LiuXinXin_2')); + $re_wx = $this->wx_qyapi->get_external_contact($param); echo json_encode($re_wx, JSON_UNESCAPED_UNICODE); } diff --git a/common/models/receiver/Receiver_customer_oplogs_model.php b/common/models/receiver/Receiver_customer_oplogs_model.php index 4ec2ca53..f6d0b384 100644 --- a/common/models/receiver/Receiver_customer_oplogs_model.php +++ b/common/models/receiver/Receiver_customer_oplogs_model.php @@ -26,7 +26,8 @@ class Receiver_customer_oplogs_model extends HD_Model */ public function typeAry($id = 0) { - $arr = [0 => '小记', 1 => '发短信', 2 => '拨打号码', 3 => '创建', 4 => '到店', 5 => '试驾', 6 => '订单', 7 => '战败']; + $arr = [0 => '小记', 1 => '发短信', 2 => '拨打号码', 3 => '创建', 4 => '到店', 5 => '试驾', 6 => '订单', 7 => '战败' + , 8 => '企微跟进']; if ($id) { return $arr[$id]; } else { diff --git a/home/controllers/h5/Persona.php b/home/controllers/h5/Persona.php index 93ed1d91..281115bb 100644 --- a/home/controllers/h5/Persona.php +++ b/home/controllers/h5/Persona.php @@ -251,8 +251,18 @@ class Persona extends CI_Controller 'c_time' => time() ]; $c_id = $this->mdCustomers->add($add_data); - $this->customers_entity->add_log($c_id, $admin_id, $admin_name, '创建客户档案', 3); - $this->customers_entity->add_log($c_id, $admin_id, $admin_name, "客户到店", 4); + if ($c_id) {//加日志 + $this->load->model('app/app_lichene_qy_log_model', 'mdWechatqyLog'); + $res_log = $this->mdWechatqyLog->select(['external_userid' => $userInfo['external_userid'] + , 'userid' => $userInfo['userid']], 'c_time asc', 0, 0, 'remark'); + if ($res_log) {//企微跟进 + foreach ($res_log as $key => $val) { + $this->customers_entity->add_log($c_id, $admin_id, $admin_name, $val['remark'], 8); + } + } + $this->customers_entity->add_log($c_id, $admin_id, $admin_name, '创建客户档案', 3); + $this->customers_entity->add_log($c_id, $admin_id, $admin_name, "客户到店", 4); + } } else { $c_id = $re_cus['id']; !$re_cus['unionid'] && $up_data['unionid'] = $userInfo['unionid'];