From febef65e68eeb3688ef098c60088c7c90c0bb4a8 Mon Sep 17 00:00:00 2001 From: dengbw Date: Wed, 1 Jun 2022 10:29:18 +0800 Subject: [PATCH] persona_601 --- .../libraries/receiver/Customers_entity.php | 19 +++++++++++++++++++ home/controllers/h5/Persona.php | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/common/libraries/receiver/Customers_entity.php b/common/libraries/receiver/Customers_entity.php index d39a040a..765f2f46 100644 --- a/common/libraries/receiver/Customers_entity.php +++ b/common/libraries/receiver/Customers_entity.php @@ -66,6 +66,25 @@ class Customers_entity return ''; } } + if ($type == 6) {//订单客户 + $count_4 = $this->ci->customer_oplogs_model->count(['customer_id' => $customer_id, 'type' => 4]); + if (!$count_4) {//无到店日志 + $this->ci->load->model('receiver/receiver_customers_model', 'mdCustomers'); + $re_cus = $this->ci->mdCustomers->get(['id' => $customer_id]); + if ($re_cus['status'] == 0) { + $up_data = ['status' => 1, 'a_num' => 1, 'cont_time' => date('Y-m-d H:i:s')];//改成到店客户 + if ($re_cus['dt_time'] == '0000-00-00 00:00:00') {//首次到店时间 + $up_data['dt_time'] = date('Y-m-d H:i:s'); + } + $this->ci->mdCustomers->update($up_data, ['id' => $customer_id]); + $this->add_log($customer_id, $uid, $uname, '客户到店', 4); + } else if ($re_cus['status'] == 1) { + $up_data['a_num = a_num+1'] = null; + $this->ci->mdCustomers->update($up_data, ['id' => $customer_id]); + $this->add_log($customer_id, $uid, $uname, '客户再次到店', 4); + } + } + } $add_data = [ 'customer_id' => $customer_id, 'uid' => $uid, diff --git a/home/controllers/h5/Persona.php b/home/controllers/h5/Persona.php index e8255bdb..841f7f57 100644 --- a/home/controllers/h5/Persona.php +++ b/home/controllers/h5/Persona.php @@ -229,7 +229,8 @@ class Persona extends CI_Controller $c_id = $userInfo['c_id']; $result = $re_cus = ''; if ($c_id) {//已存在客户,更新资料 - $up_data = ['of_id' => $params['of_id'], 'of2_id' => $params['of2_id'], 'buddy_type' => $params['buddy_type']]; + $up_data = ['of_id' => $params['of_id'], 'of2_id' => $params['of2_id'], 'buddy_type' => $params['buddy_type'] + , 'wxqy' => 1]; $result = $this->mdCustomers->update($up_data, ['id' => $c_id]); $this->customers_entity->add_log($c_id, $userInfo['admin_id'], $userInfo['admin_name'], '修改用户基本信息'); } else {