From 5fdcca327a02b17df0c9f7ea655b14f20d2cd60d Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Mon, 1 Nov 2021 10:00:35 +0800 Subject: [PATCH] edit-api-order_time and filter customer --- api/controllers/wxapp/licheb/Cusorder.php | 6 ++++-- api/controllers/wxapp/licheb/Cusorder2.php | 4 +++- api/controllers/wxapp/licheb/Customers.php | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php index eb769a3f..ba7f1d13 100644 --- a/api/controllers/wxapp/licheb/Cusorder.php +++ b/api/controllers/wxapp/licheb/Cusorder.php @@ -42,6 +42,7 @@ class Cusorder extends Wxapp{ $this->load->model('sys/sys_finance_model'); $this->load->library('receiver/orders_entity'); + $this->load->library('receiver/customers_entity'); } protected function get(){ @@ -205,8 +206,9 @@ class Cusorder extends Wxapp{ } //更新客户下单时间 - $this->customers_model->update(array('order_time' => strtotime('now')),['id'=>$cus_id]); - + $this->customers_model->update(array('order_time' => date('Y-m-d H:i:s')),['id'=>$cus_id]); + $this->customers_entity->add_log($cus_id, $this->session['uid'], $this->session['uname'], "新增订单"); + return ['id'=>$o_id]; }else{ throw new Exception('创建失败', ERR_PARAMS_ERROR); diff --git a/api/controllers/wxapp/licheb/Cusorder2.php b/api/controllers/wxapp/licheb/Cusorder2.php index 5e1b1e54..f3b2d33b 100644 --- a/api/controllers/wxapp/licheb/Cusorder2.php +++ b/api/controllers/wxapp/licheb/Cusorder2.php @@ -34,6 +34,7 @@ class Cusorder2 extends Wxapp{ $this->load->model('app/liche/app_liche_orders_model'); $this->load->library('receiver/orders_entity'); + $this->load->library('receiver/customers_entity'); } protected function get(){ @@ -106,7 +107,8 @@ class Cusorder2 extends Wxapp{ } //更新客户下单时间 - $this->customers_model->update(array('order_time' => strtotime('now')),['id'=>$cus_id]); + $this->customers_model->update(array('order_time' => date('Y-m-d H:i:s')),['id'=>$cus_id]); + $this->customers_entity->add_log($cus_id, $this->session['uid'], $this->session['uname'], "新增订单"); //增加分销记录 $this->load->library('entity/deal_entity',['app_id'=>1]); diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index f79deca5..b25b4212 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -427,8 +427,8 @@ class Customers extends Wxapp strlen($status) && $where['status'] = $status; $level && $where['level'] = $level; $cfrom && $where['cf_title'] = $cfrom; - $name && $where['name'] = $name; - $mobile && $where['mobile'] = $mobile; + $name && $where["name like '%{$name}%'"] = null; + $mobile && $where["mobile like '%$mobile%'"] = null; $cf_clues && $where['cf_clues'] = $cf_clues; $count = $this->customers_model->count($where);