From 1eecc85551f7998fdeabea8bec0c49e1e0c67ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Fri, 9 May 2025 14:19:55 +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=AE=BE=E5=A4=87=E8=AF=A6=E6=83=85=E4=B8=AD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=AE=BE=E5=A4=87=E7=BB=91=E5=AE=9A=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E6=80=BB=E6=95=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/GetDeviceDetailV1Controller.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Server/application/cunkebao/controller/device/GetDeviceDetailV1Controller.php b/Server/application/cunkebao/controller/device/GetDeviceDetailV1Controller.php index 6e5a454b..dbbfdff0 100644 --- a/Server/application/cunkebao/controller/device/GetDeviceDetailV1Controller.php +++ b/Server/application/cunkebao/controller/device/GetDeviceDetailV1Controller.php @@ -66,16 +66,13 @@ class GetDeviceDetailV1Controller extends BaseController */ protected function getTaskConfig(int $deviceId): array { - $where = [ - 'deviceId' => $deviceId, - 'companyId' => $this->getUserInfo('companyId'), - ]; + $companyId = $this->getUserInfo('companyId'); $conf = DeviceTaskconfModel::alias('c') ->field([ 'c.autoAddFriend', 'c.autoReply', 'c.momentsSync', 'c.aiChat' ]) - ->where($where) + ->where(compact('companyId', 'deviceId')) ->find(); if (!is_null($conf)) { @@ -95,12 +92,9 @@ class GetDeviceDetailV1Controller extends BaseController */ protected function getTotalFriend(int $deviceId): int { - $where = [ - 'deviceId' => $deviceId, - 'companyId' => $this->getUserInfo('companyId'), - ]; + $companyId = $this->getUserInfo('companyId'); - $ownerWechatId = DeviceWechatLogin::where($where)->order('createTime desc')->value('wechatId'); + $ownerWechatId = DeviceWechatLogin::where(compact('companyId', 'deviceId'))->order('createTime desc')->value('wechatId'); if ($ownerWechatId) { return WechatFriend::where(['ownerWechatId' => $ownerWechatId])->count(); @@ -110,7 +104,7 @@ class GetDeviceDetailV1Controller extends BaseController } /** - * 获取设备绑定微信你的消息总数 + * TODO 获取设备绑定微信的消息总数 * * @return int */