From 2ad1b99ea3940a3f436e2d54ce7c72e2c6856b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Wed, 14 May 2025 15:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=81=E5=9F=9F=E6=93=8D=E7=9B=98=E6=89=8B?= =?UTF-8?q?=20-=20=E8=B0=83=E6=95=B4=E5=BE=AE=E4=BF=A1=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E9=99=90=E5=88=B6=E8=AE=B0=E5=BD=95=E8=87=B3=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?WechatRestrictsModel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cunkebao/app/wechat-accounts/[id]/page.tsx | 24 +++++++++------ .../common/model/WechatRestricts.php | 17 +++++++++++ ...GetWechatOnDeviceSummarizeV1Controller.php | 29 ++++++++----------- 3 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 Server/application/common/model/WechatRestricts.php diff --git a/Cunkebao/app/wechat-accounts/[id]/page.tsx b/Cunkebao/app/wechat-accounts/[id]/page.tsx index fac8dd48..1d24e07e 100644 --- a/Cunkebao/app/wechat-accounts/[id]/page.tsx +++ b/Cunkebao/app/wechat-accounts/[id]/page.tsx @@ -1010,17 +1010,23 @@ export default function WechatAccountDetailPage() {
- {accountSummary && accountSummary.restrictions.map((record) => ( -
-
-
- {record.reason} + {accountSummary?.restrictions?.length > 0 ? ( + accountSummary.restrictions.map((record) => ( +
+
+
+ {record.reason} +
+ {formatDateTime(record.date)} +
+
恢复时间:{formatDateTime(record.date)}
- {formatDateTime(record.date)} -
-
恢复时间:{formatDateTime(record.date)}
+ )) + ) : ( +
+ 暂无风险记录,请继续保持
- ))} + )}
diff --git a/Server/application/common/model/WechatRestricts.php b/Server/application/common/model/WechatRestricts.php new file mode 100644 index 00000000..060c9ffb --- /dev/null +++ b/Server/application/common/model/WechatRestricts.php @@ -0,0 +1,17 @@ + 1, - 'level' => 2, - 'reason' => '频繁添加好友', - 'date' => date('Y-m-d H:i:s', strtotime('-1 day')), - ], - [ - 'id' => 2, - 'level' => 3, - 'reason' => '营销内容违规', - 'date' => date('Y-m-d H:i:s', strtotime('-1 day')), - ], - ]; + return WechatRestrictsModel::alias('r') + ->field( + [ + 'r.id', 'r.restrictTime date', 'r.level', 'r.reason' + ] + ) + ->where('r.wechatId', $wechatId)->select() + ->toArray(); } /** @@ -92,7 +87,7 @@ class GetWechatOnDeviceSummarizeV1Controller extends BaseController */ protected function getDateDiff(string $wechatId): int { - $currentData = new \DateTime(date('Y-m-d H:i:s', time())); + $currentData = new \DateTime(date('Y-m-d H:i:s', time())); $registerDate = new \DateTime($this->getRegisterDate($wechatId)); $interval = date_diff($currentData, $registerDate); @@ -208,7 +203,7 @@ class GetWechatOnDeviceSummarizeV1Controller extends BaseController */ protected function getTodayNewFriendCount(string $ownerWechatId): int { - return WechatFriendShipModel::where( compact('ownerWechatId') ) + return WechatFriendShipModel::where(compact('ownerWechatId')) ->whereBetween('createTime', [ strtotime(date('Y-m-d 00:00:00')),