代码优化

This commit is contained in:
wong
2025-07-22 16:03:09 +08:00
parent 3bd7290846
commit 00b56f75fe

View File

@@ -1228,12 +1228,13 @@ class Adapter implements WeChatServiceInterface
public function syncTrafficSourceUser() public function syncTrafficSourceUser()
{ {
$sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`) $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`)
SELECT SELECT
f.wechatId identifier, f.wechatId identifier,
c.departmentId companyId, c.departmentId companyId,
f.ownerNickname fromd, f.ownerNickname fromd,
f.ownerWechatId sourceId f.ownerWechatId sourceId,
f.createTime createTime
FROM FROM
s2_wechat_friend f s2_wechat_friend f
LEFT JOIN s2_wechat_account a ON f.wechatAccountId = a.id LEFT JOIN s2_wechat_account a ON f.wechatAccountId = a.id
@@ -1260,12 +1261,13 @@ class Adapter implements WeChatServiceInterface
public function syncTrafficSourceGroup() public function syncTrafficSourceGroup()
{ {
$sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`) $sql = "insert into ck_traffic_source(`identifier`,companyId,`fromd`,`sourceId`,`createTime`)
SELECT SELECT
m.wechatId identifier, m.wechatId identifier,
c.departmentId companyId, c.departmentId companyId,
r.nickname fromd, r.nickname fromd,
f.ownerWechatId sourceId m.chatroomId sourceId,
m.createTime createTime
FROM FROM
s2_wechat_chatroom_member m s2_wechat_chatroom_member m
JOIN s2_wechat_chatroom r ON m.chatroomId = r.chatroomId JOIN s2_wechat_chatroom r ON m.chatroomId = r.chatroomId