From 6d9d56008def595ff3bf504754282e15fd6de19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Sat, 10 May 2025 11:19:51 +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=E5=BE=AE=E4=BF=A1=E5=8F=B7=E5=88=97=E8=A1=A8=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E4=BB=8A=E6=97=A5=E6=96=B0=E5=A2=9E=E5=A5=BD=E5=8F=8B?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=A1=A5=E5=85=85=E4=B8=9A=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wechat/GetWechatsOnDevicesV1Controller.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Server/application/cunkebao/controller/wechat/GetWechatsOnDevicesV1Controller.php b/Server/application/cunkebao/controller/wechat/GetWechatsOnDevicesV1Controller.php index 3554d3aa..84e008fb 100644 --- a/Server/application/cunkebao/controller/wechat/GetWechatsOnDevicesV1Controller.php +++ b/Server/application/cunkebao/controller/wechat/GetWechatsOnDevicesV1Controller.php @@ -29,14 +29,21 @@ class GetWechatsOnDevicesV1Controller extends BaseController } /** - * TODO 计算今日新增好友数量 + * 计算今日新增好友数量 * - * @param string $wechatId + * @param string $ownerWechatId * @return int */ - protected function getTodayNewFriendCount(string $wechatId): int + protected function getTodayNewFriendCount(string $ownerWechatId): int { - return 0; + return WechatFriendModel::where( compact('ownerWechatId') ) + ->whereBetween('createTime', + [ + strtotime(date('Y-m-d 00:00:00')), + strtotime(date('Y-m-d 23:59:59')) + ] + ) + ->count('*'); } /**