增加自媒体渠道

This commit is contained in:
2026-04-23 15:43:22 +08:00
parent 366b005d78
commit 54431cbeb1
19 changed files with 737 additions and 47 deletions
@@ -12,4 +12,5 @@ INSERT INTO `zyt_system_menu`
VALUES
(@account_cost_menu_id, 'A', '新增', '', 1, 'finance.account_cost/add', '', '', '', '', 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
(@account_cost_menu_id, 'A', '编辑', '', 2, 'finance.account_cost/edit', '', '', '', '', 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
(@account_cost_menu_id, 'A', '详情', '', 3, 'finance.account_cost/detail', '', '', '', '', 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
(@account_cost_menu_id, 'A', '详情', '', 3, 'finance.account_cost/detail', '', '', '', '', 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()),
(@account_cost_menu_id, 'A', '删除', '', 4, 'finance.account_cost/delete', '', '', '', '', 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP());
@@ -0,0 +1,25 @@
INSERT INTO `zyt_system_menu`
(`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`, `selected`, `params`, `is_show`, `is_disable`, `create_time`, `update_time`)
SELECT
parent.id,
'A',
'删除',
'',
4,
'finance.account_cost/delete',
'',
'',
'',
'',
1,
0,
UNIX_TIMESTAMP(),
UNIX_TIMESTAMP()
FROM `zyt_system_menu` parent
WHERE parent.perms = 'finance.account_cost/lists'
AND NOT EXISTS (
SELECT 1
FROM `zyt_system_menu` child
WHERE child.pid = parent.id
AND child.perms = 'finance.account_cost/delete'
);
@@ -0,0 +1,30 @@
CREATE TABLE IF NOT EXISTS `zyt_qywx_media_channel` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`channel_code` varchar(80) NOT NULL DEFAULT '' COMMENT '渠道编码:由 tag_id 或 tag_name 生成',
`channel_name` varchar(100) NOT NULL DEFAULT '' COMMENT '渠道名称(展示名)',
`source_tag_id` varchar(64) NOT NULL DEFAULT '' COMMENT '企微标签ID',
`source_tag_name` varchar(100) NOT NULL DEFAULT '' COMMENT '企微标签名',
`source_group_name` varchar(100) NOT NULL DEFAULT '' COMMENT '企微标签组名',
`tag_uniq_key` varchar(120) NOT NULL DEFAULT '' COMMENT '标签唯一键:优先 tag_id,否则 tag_name 哈希',
`status` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '状态:1=启用',
`last_seen_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '最近扫描命中时间',
`create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_channel_code` (`channel_code`),
UNIQUE KEY `uk_tag_uniq_key` (`tag_uniq_key`),
KEY `idx_status` (`status`),
KEY `idx_last_seen_time` (`last_seen_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企微渠道标签源表';
ALTER TABLE `zyt_account_cost`
ADD COLUMN `media_channel_code` varchar(80) NOT NULL DEFAULT '' COMMENT '渠道编码' AFTER `cost_date`,
ADD COLUMN `media_channel_name` varchar(100) NOT NULL DEFAULT '' COMMENT '渠道名称' AFTER `media_channel_code`;
ALTER TABLE `zyt_account_cost`
DROP INDEX `uk_cost_date`,
ADD UNIQUE KEY `uk_cost_date_channel` (`cost_date`, `media_channel_code`),
ADD KEY `idx_cost_date_channel` (`cost_date`, `media_channel_code`);
-- 初始化渠道源
-- php think qywx:scan-media-channel