This commit is contained in:
Your Name
2026-04-18 15:54:14 +08:00
parent fa3da15228
commit 4097fe0cc6
271 changed files with 1257 additions and 369 deletions
@@ -0,0 +1,4 @@
-- 企微侧「首次添加为外部联系人」时间:follow_user[].createtime 的最小值(同步时写入)
ALTER TABLE `zyt_qywx_external_contact`
ADD COLUMN `external_first_add_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '企微侧首次添加外部联系人时间(Unix秒)' AFTER `follow_admin_ids`,
ADD KEY `idx_external_first_add_time` (`external_first_add_time`);
@@ -0,0 +1,4 @@
-- 企微客户跟进人:解析 follow_user.userid 后匹配 zyt_admin.work_wechat_userid,写入后台管理员 id 列表(JSON 数组)
-- 使用可空列:兼容各 MySQL 版本向已有数据表加 TEXT 列;同步与接口均按空视为 []
ALTER TABLE `zyt_qywx_external_contact`
ADD COLUMN `follow_admin_ids` text NULL COMMENT '跟进人对应后台管理员ID列表JSON' AFTER `follow_users`;
@@ -12,6 +12,8 @@ CREATE TABLE IF NOT EXISTS `zyt_qywx_external_contact` (
`corp_full_name` varchar(255) NOT NULL DEFAULT '' COMMENT '企业全称',
`external_profile` text COMMENT '外部联系人扩展信息JSON',
`follow_users` text COMMENT '跟进人列表JSON',
`follow_admin_ids` text NULL COMMENT '跟进人对应后台管理员ID列表JSON',
`external_first_add_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '企微侧首次添加外部联系人时间(Unix秒)',
`create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '添加时间',
`update_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
`delete_time` int(11) unsigned DEFAULT NULL COMMENT '删除时间',
@@ -19,6 +21,7 @@ CREATE TABLE IF NOT EXISTS `zyt_qywx_external_contact` (
UNIQUE KEY `uk_external_userid` (`external_userid`),
KEY `idx_name` (`name`),
KEY `idx_unionid` (`unionid`),
KEY `idx_external_first_add_time` (`external_first_add_time`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企业微信外部联系人表';