From ad8eab3fe55ee6dc3a2aabe3f9544d7d70c1cbff Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Wed, 23 Jul 2025 14:10:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E9=87=8F=E6=B1=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=A5=E6=BA=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php index 171bbd5f..86f6027d 100644 --- a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php +++ b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php @@ -1228,14 +1228,15 @@ class Adapter implements WeChatServiceInterface public function syncTrafficSourceUser() { - $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`,`type`) + $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`,`type`, `status`) SELECT f.wechatId identifier, c.departmentId companyId, f.ownerNickname fromd, f.ownerWechatId sourceId, f.createTime createTime, - 1 as type + 1 as type, + CASE WHEN f.isDeleted = 1 THEN -3 ELSE 3 END as status FROM s2_wechat_friend f LEFT JOIN s2_wechat_account a ON f.wechatAccountId = a.id @@ -1262,14 +1263,15 @@ class Adapter implements WeChatServiceInterface public function syncTrafficSourceGroup() { - $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`,`type`) + $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`,`type`, `status`) SELECT m.wechatId identifier, c.departmentId companyId, r.nickname fromd, m.chatroomId sourceId, m.createTime createTime, - 2 as type + 2 as type, + CASE WHEN m.friendType = 1 THEN 3 ELSE 1 END as status FROM s2_wechat_chatroom_member m JOIN s2_wechat_chatroom r ON m.chatroomId = r.chatroomId