From f877161d4a8f7b25f9bc5bd75e553e1fc26ceb16 Mon Sep 17 00:00:00 2001 From: dengbw Date: Mon, 13 Sep 2021 15:49:06 +0800 Subject: [PATCH] admin_customers_913 --- admin/controllers/receiver/Clues.php | 2 +- admin/controllers/receiver/Customer.php | 44 ++++-- admin/views/receiver/customer/lists.php | 140 ++++++++++++------ api/controllers/wxapp/licheb/Customers.php | 3 + .../libraries/receiver/Customers_entity.php | 2 +- 5 files changed, 130 insertions(+), 61 deletions(-) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 0c5f925d..e0e791c2 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -543,7 +543,7 @@ class Clues extends HD_Controller 'if_driver' => $clues_row['if_driver'], 'cf_title' => '平台分配', 'p_time' => date('Y-m-d H:i:s'), - 'c_time' => time() + 'c_time' => $clues_row['c_time'] ]; if ($jsondata['car']) { isset($jsondata['car']['version']) && $add_data['v_id'] = $jsondata['car']['version']['id']; diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index ae8d27b3..b2a729d4 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -10,6 +10,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class Customer extends HD_Controller { private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名'); + private $searchTimeAry = array('c_time' => '创建时间', 'p_time' => '分配时间', 'cont_time' => '最后联系时间', 'u_time' => '最后操作时间' + , 'dt_time' => '最后到店时间'); protected $log_dir; @@ -49,23 +51,36 @@ class Customer extends HD_Controller $where["{$params['search_tp']} like '%{$params['title']}%'"] = null; } !$params['search_tp'] && $params['search_tp'] = 'mobile'; - - //最近联系时间 - if ($params['cont_time']) { - $cont_time = explode(' ~ ', $params['cont_time']); - if ($cont_time[0]) { - $where["cont_time >="] = $cont_time[0] . ' 00:00:00'; - } - if ($cont_time[1]) { - $where["cont_time <="] = $cont_time[1] . ' 23:59:59'; - } - } strlen($params['status']) && $where["status"] = $params['status']; $params['city_id'] && $where['city_id'] = $params['city_id']; $params['county_id'] && $where['county_id'] = $params['county_id']; $params['biz_id'] && $where['biz_id'] = $params['biz_id']; $params['cf_title'] && $where['cf_title'] = $params['cf_title']; - + if ($params['c_time']) { + $c_time = explode(' ~ ', $params['c_time']); + $c_time[0] && $where["c_time >="] = strtotime($c_time[0] . ' 00:00:00'); + $c_time[1] && $where["c_time <="] = strtotime($c_time[1] . ' 23:59:59'); + } + if ($params['p_time']) { + $p_time = explode(' ~ ', $params['p_time']); + $p_time[0] && $where["p_time >="] = $p_time[0] . ' 00:00:00'; + $p_time[1] && $where["p_time <="] = $p_time[1] . ' 23:59:59'; + } + if ($params['cont_time']) { + $cont_time = explode(' ~ ', $params['cont_time']); + $cont_time[0] && $where["cont_time >="] = $cont_time[0] . ' 00:00:00'; + $cont_time[1] && $where["cont_time <="] = $cont_time[1] . ' 23:59:59'; + } + if ($params['u_time']) { + $u_time = explode(' ~ ', $params['u_time']); + $u_time[0] && $where["u_time >="] = $u_time[0] . ' 00:00:00'; + $u_time[1] && $where["u_time <="] = $u_time[1] . ' 23:59:59'; + } + if ($params['dt_time']) { + $dt_time = explode(' ~ ', $params['dt_time']); + $dt_time[0] && $where["dt_time >="] = $dt_time[0] . ' 00:00:00'; + $dt_time[1] && $where["dt_time <="] = $dt_time[1] . ' 23:59:59'; + } $count = $this->customers_model->count($where); $lists = []; if ($count) { @@ -87,13 +102,14 @@ class Customer extends HD_Controller 'status_name' => $status_arr[$val['status']], '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'] : '', - 'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '', + 'cont_time' => $val['cont_time'] != '0000-00-00 00:00:00' ? $val['cont_time'] : '', ); } } $this->data['lists'] = $lists; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); $this->data['searchTpAry'] = $this->searchTpAry; + $this->data['searchTimeAry'] = $this->searchTimeAry; $this->data['params'] = $params; $this->data['status_arr'] = $status_arr; $this->data['_title'] = '客户列表'; @@ -180,7 +196,7 @@ class Customer extends HD_Controller 'log' => $value['log'], 'rec_url' => $rec_url, 'rec_text' => $rec_text, - 'type_name' => $this->customer_oplogs_model->typeAry()[$value['type']], + 'type_name' => $this->customer_oplogs_model->typeAry()[$value['type']], 'c_time' => date('Y-m-d H:i', $value['c_time']) ); } diff --git a/admin/views/receiver/customer/lists.php b/admin/views/receiver/customer/lists.php index a21590d5..1a751968 100644 --- a/admin/views/receiver/customer/lists.php +++ b/admin/views/receiver/customer/lists.php @@ -18,7 +18,7 @@