From 0244871fc1fa672ed9c9ca0bca110f6474223f08 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Fri, 28 Nov 2025 16:04:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8F=8B/=E7=BE=A4=E8=81=8A=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chukebao/controller/DataProcessing.php | 14 ++++---- .../Adapters/ChuKeBao/Adapter.php | 33 ++++++++++--------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Server/application/chukebao/controller/DataProcessing.php b/Server/application/chukebao/controller/DataProcessing.php index 887fb2ef..fdde86b7 100644 --- a/Server/application/chukebao/controller/DataProcessing.php +++ b/Server/application/chukebao/controller/DataProcessing.php @@ -84,25 +84,25 @@ class DataProcessing extends BaseController if (!empty($wechatFriendId)){ - $dsta = WechatFriendModel::where(['id' => $wechatFriendId,'wechatAccountId' => $wechatAccountId])->find(); + $data = WechatFriendModel::where(['id' => $wechatFriendId,'wechatAccountId' => $wechatAccountId])->find(); $msg = '好友转移成功'; - if(empty($ddta)){ + if(empty($data)){ return ResponseHelper::error('好友不存在'); } } if (!empty($wechatChatroomId)){ - $dsta = WechatChatroomModel::where(['id' => $wechatChatroomId,'wechatAccountId' => $wechatAccountId])->find(); + $data = WechatChatroomModel::where(['id' => $wechatChatroomId,'wechatAccountId' => $wechatAccountId])->find(); $msg = '群聊转移成功'; - if(empty($ddta)){ + if(empty($data)){ return ResponseHelper::error('群聊不存在'); } } - $dsta->accountId = $toAccountId; - $dsta->updateTime = time(); - $dsta->save(); + $data->accountId = $toAccountId; + $data->updateTime = time(); + $data->save(); break; case 'CmdNewMessage': if(empty($friendMessage) && empty($chatroomMessage)){ diff --git a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php index 247684bc..d89bf8ea 100644 --- a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php +++ b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php @@ -307,7 +307,7 @@ class Adapter implements WeChatServiceInterface $conf = array_merge($task_info['reqConf'], ['task_name' => $task_info['name'], 'tags' => $tags]); - $this->createFriendAddTask($accountId, $task['phone'], $conf); + $this->createFriendAddTask($accountId, $task['phone'], $conf, $task['remark']); $friendAddTaskCreated = true; $task['processed_wechat_ids'] = $task['processed_wechat_ids'] . ',' . $wechatId; // 处理失败任务用,用于过滤已处理的微信号 break; @@ -951,28 +951,29 @@ class Adapter implements WeChatServiceInterface } // 创建添加好友任务/执行添加 - public function createFriendAddTask(int $wechatAccountId, string $phone, array $conf) + public function createFriendAddTask(int $wechatAccountId, string $phone, array $conf, $remark = '') { if (empty($wechatAccountId) || empty($phone) || empty($conf)) { return; } - switch ($conf['remarkType']) { - case 'phone': - $remark = $phone . '-' . $conf['task_name']; - break; - case 'nickname': - $remark = ''; - break; - case 'source': - $remark = $conf['task_name']; - break; - default: - $remark = ''; - break; + if (empty($remark)){ + switch ($conf['remarkType']) { + case 'phone': + $remark = $phone . '-' . $conf['task_name']; + break; + case 'nickname': + $remark = ''; + break; + case 'source': + $remark = $conf['task_name']; + break; + default: + $remark = ''; + break; + } } - $tags = []; if (!empty($conf['tags'])) { if (is_array($conf['tags'])) {