From fc9f067098e45ba258d20edf2e914d821cae0065 Mon Sep 17 00:00:00 2001 From: dengbw Date: Tue, 12 Apr 2022 10:30:44 +0800 Subject: [PATCH] customer_412 --- admin/controllers/receiver/Customer.php | 2 +- api/controllers/wxapp/licheb/Customers.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index e2a7bb10..51b5514a 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -257,7 +257,7 @@ class Customer extends HD_Controller //获取销售员 $row_admin = $this->app_licheb_users_model->get(array('id' => $row['admin_id']), 'id,uname'); //操作日志 - $rows_log = $this->customer_oplogs_model->select(array('customer_id' => $id), 'c_time desc', 0, 0); + $rows_log = $this->customer_oplogs_model->select(array('customer_id' => $id), 'id desc', 0, 0); //用户信息 if (SUPER_ADMIN == $this->role || 35 == $this->role) { $mobile_sub = $row['mobile']; diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 37c46d43..37d28b36 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -270,7 +270,7 @@ class Customers extends Wxapp //]; $this->load->library('receiver/customers_entity'); $level = $this->customers_entity->cal_level($buy_time); - + $time = date('Y-m-d H:i:s'); $add_data = [ 'name' => $name, 'mobile' => $mobile, @@ -282,12 +282,13 @@ class Customers extends Wxapp 'level' => $level, 'cf_title' => '自有资源', //'car_json' => json_encode($car_json, JSON_UNESCAPED_UNICODE), - 'cont_time' => date('Y-m-d H:i:s'), + 'cont_time' => $time, 'status' => $status, 'c_time' => time() ]; if ($status == 1) {//到店客户 到店次数默认1 $add_data['a_num'] = 1; + $add_data['dt_time'] = $time; } $biz_row['city_id'] && $add_data['city_id'] = $biz_row['city_id']; $biz_row['county_id'] && $add_data['county_id'] = $biz_row['county_id']; @@ -315,9 +316,13 @@ class Customers extends Wxapp $this->mdCustomerTagdata->add_batch($add_tag); } } + $uid = $this->session['uid']; $uname = $this->session['uname']; $this->load->library('receiver/customers_entity'); - $this->customers_entity->add_log($id, $this->session['uid'], $uname, "创建客户"); + $this->customers_entity->add_log($id, $uid, $uname, "创建客户"); + if ($status == 1) {//到店客户加日志 + $this->customers_entity->add_log($id, $uid, $uname, "到店+1"); + } throw new Exception('创建成功', API_CODE_SUCCESS); } else { throw new Exception('创建失败', ERR_PARAMS_ERROR);