From 5ae97c9feed838f8055a539b8d106e45dde44aed Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 14 Aug 2025 19:49:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/UserController.php | 2 +- app/common/service/UserService.php | 4 ++++ app/crm/service/CustomerService.php | 8 ++++++++ app/crmAdmin/service/CustomerService.php | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/common/controller/UserController.php b/app/common/controller/UserController.php index d4fe0f4..f49fba0 100644 --- a/app/common/controller/UserController.php +++ b/app/common/controller/UserController.php @@ -46,7 +46,7 @@ class UserController extends BaseController public function resignMember(Request $request) { try { - $userId = $request->post('user_id'); + $userId = $request->get('user_id'); if(empty($userId)){ return $this->error('组员id不能为空'); } diff --git a/app/common/service/UserService.php b/app/common/service/UserService.php index f3c28d1..fef0f63 100644 --- a/app/common/service/UserService.php +++ b/app/common/service/UserService.php @@ -185,6 +185,10 @@ class UserService // $config['where']['status'] = 1; // 关键字 $config['order']['id'] = 'desc'; + if (isset($p['status']) && $p['status']) { + $config['where']['status'] = $p['status']; + } + $config['dataLimit']['type'] = 'relation'; $config['dataLimit']['userId'] = $request->user->uid; $config['dataLimit']['userField'] = 'report_to'; diff --git a/app/crm/service/CustomerService.php b/app/crm/service/CustomerService.php index 29c84ce..2096b5a 100644 --- a/app/crm/service/CustomerService.php +++ b/app/crm/service/CustomerService.php @@ -89,6 +89,7 @@ class CustomerService $query->where(function ($query) use ($keyword) { $query->where('contacts', 'like', "%{$keyword}%") ->orWhere('phone', 'like', "%{$keyword}%") + ->orWhere('email', 'like', "%{$keyword}%") ->orWhere('WhatsApp', 'like', "%{$keyword}%") ->orWhere('code', 'like', "%{$keyword}%"); }); @@ -154,9 +155,16 @@ class CustomerService switch ($scene) { case 'index': $config['where']['status'] = 1; // 关键字 + if (isset($p['user_id']) && $p['user_id']) { + $config['where']['user_id'] = $p['user_id']; + } // 关键字 if (isset($p['keyword']) && $p['keyword']) { $k = '%' . $p['keyword'] . '%'; $config['where']['contacts'] = ['like', $k]; + $config['where']['phone'] = ['like', $k]; + $config['where']['email'] = ['like', $k]; + $config['where']['WhatsApp'] = ['like', $k]; + $config['where']['code'] = ['like', $k]; } $config['order']['id'] = 'desc'; $config['dataLimit']['type'] = 'relation'; diff --git a/app/crmAdmin/service/CustomerService.php b/app/crmAdmin/service/CustomerService.php index 159afbd..074f341 100644 --- a/app/crmAdmin/service/CustomerService.php +++ b/app/crmAdmin/service/CustomerService.php @@ -106,6 +106,7 @@ class CustomerService $query->where(function ($query) use ($keyword) { $query->where('contacts', 'like', "%{$keyword}%") ->orWhere('phone', 'like', "%{$keyword}%") + ->orWhere('email', 'like', "%{$keyword}%") ->orWhere('WhatsApp', 'like', "%{$keyword}%") ->orWhere('code', 'like', "%{$keyword}%"); });