From 1500e39bb05b6abd087dbf7097d15ed6770d5dea Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 25 Aug 2025 15:05:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/CustomerController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controller/CustomerController.php b/app/controller/CustomerController.php index bfa77af..af5cacd 100644 --- a/app/controller/CustomerController.php +++ b/app/controller/CustomerController.php @@ -166,6 +166,7 @@ class CustomerController }else{ $where[] = ['user_id', $userId]; } + $where[] = ['status', 1]; if (!empty($countryId)){ $where[] = ['country_id', $countryId]; } @@ -328,8 +329,10 @@ class CustomerController return Util::fail([], trans('contacts_not_null')); } + $user = User::where(['id' => $request->user['id']])->first(); $data = [ 'user_id' => $request->user['id'], + 'corp_id' => $user->corp_id, 'grade' => Util::getParam($request, 'grade', 0), 'channel_id' => $channel_id, 'country_id' => $country_id, @@ -375,8 +378,11 @@ class CustomerController if (Util::isEmpty($customerId)) { return Util::fail([], trans('customer_id').trans('not_null')); } + $user = User::where(['id' => $userId])->first(); $data = [ - 'user_id' => $request->user['id'] + 'user_id' => $request->user['id'], + 'obtain' => time(), + 'corp_id' => $user->corp_id, ]; $customer= Customer::withTrashed()->find($customerId); @@ -435,7 +441,12 @@ class CustomerController 'user_id' => $user['id'], ]); } - $res = $query->update(['user_id' => $user->id]); + + $data = [ + 'user_id' => $user->id, + 'obtain' => time(), + ]; + $res = $query->update($data); if ($res) {