From 68eb23e3163f368db38f09ba18656612d1ba0d8c Mon Sep 17 00:00:00 2001 From: "HESU\\HESU" <1696136552@qq.com> Date: Tue, 25 Mar 2025 13:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E8=B7=9F=E8=BF=9B=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/CustomerController.php | 11 ++++++++--- app/controller/FollowController.php | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controller/CustomerController.php b/app/controller/CustomerController.php index 674752e..bab9349 100644 --- a/app/controller/CustomerController.php +++ b/app/controller/CustomerController.php @@ -68,11 +68,16 @@ class CustomerController $userId = $request->user['id']; $where = [ ['user_id', '=', $userId], + ['follow_next', '<>', 0], // ['follow_next', '<=', time() + 3600 * 24], - ['follow_next', '>', time()], - ['warn', '<', 1] +// ['follow_next', '>', time()], +// ['warn', '<', 1] ]; - $customer = Customer::where($where)->orderBy('follow_next')->get(); + $customer = Customer::where($where)->whereNotNull('follow_next')->orderBy('follow_next')->get(); + + foreach ($customer as &$item) { + $item['follow_remaining'] = $item->follow_next-time(); + } return Util::success($customer,trans('success')); } diff --git a/app/controller/FollowController.php b/app/controller/FollowController.php index c4bd59a..c92e599 100644 --- a/app/controller/FollowController.php +++ b/app/controller/FollowController.php @@ -146,6 +146,8 @@ class FollowController $customer = Customer::find($customer_id); $customer->follow_last = strtotime($res->created_at); + $customer->follow_next = null; + $customer->warn = 0; $customer->save(); if ($res) {