From 21030d98dc3c0d6c0de2697e975e1eb2daa69420 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Fri, 12 Jan 2024 13:50:48 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=94=A8=E6=88=B7=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/logic/user/UserLogic.php | 1 + app/api/logic/UserLogic.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/adminapi/logic/user/UserLogic.php b/app/adminapi/logic/user/UserLogic.php index 2cb38960..aea9a9ec 100644 --- a/app/adminapi/logic/user/UserLogic.php +++ b/app/adminapi/logic/user/UserLogic.php @@ -121,6 +121,7 @@ class UserLogic extends BaseLogic 'register_num' => $params['register_num'], 'merchant_num' => $params['merchant_num'], 'trade_amount' => $params['trade_amount'], + 'update_time' => time() ]); } diff --git a/app/api/logic/UserLogic.php b/app/api/logic/UserLogic.php index 821d8892..7eeeff0c 100644 --- a/app/api/logic/UserLogic.php +++ b/app/api/logic/UserLogic.php @@ -95,10 +95,15 @@ class UserLogic extends BaseLogic $name=DictData::where('id',$data['company']['company_type'])->value('name'); $data['company']['company_type_name']=$name; } - $inviteUserStatistics = ShopRequestLogic::getInviteUserInfo(['promotion_code' => $data['invite_code']]); - $data['register_num'] = $inviteUserStatistics['data']['user_count']; - $data['merchant_num'] = $inviteUserStatistics['data']['merchant_count']; - $data['trade_amount'] = $inviteUserStatistics['data']['trade_amount']; + if (date('Y-m-d', strtotime($data['update_time'])) == date('Y-m-d', time())) { + + } else { + $inviteUserStatistics = ShopRequestLogic::getInviteUserInfo(['promotion_code' => $data['invite_code']]); + $data['register_num'] = $inviteUserStatistics['data']['user_count']; + $data['merchant_num'] = $inviteUserStatistics['data']['merchant_count']; + $data['trade_amount'] = $inviteUserStatistics['data']['trade_amount']; + } + return $data ; }