自媒体渠道绑定部门

This commit is contained in:
2026-04-27 12:50:35 +08:00
parent 5cb9706274
commit a89c7cce62
10 changed files with 457 additions and 43 deletions
@@ -2,6 +2,10 @@ CREATE TABLE IF NOT EXISTS `zyt_account_cost` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`cost_date` date NOT NULL COMMENT '账户消耗日期',
`amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '账户消耗金额',
`dept_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '绑定部门ID',
`dept_name` varchar(100) NOT NULL DEFAULT '' COMMENT '绑定部门名称',
`media_channel_code` varchar(80) NOT NULL DEFAULT '' COMMENT '渠道编码',
`media_channel_name` varchar(100) NOT NULL DEFAULT '' COMMENT '渠道名称',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
`creator_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人ID',
`creator_name` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人姓名',
@@ -10,6 +14,7 @@ CREATE TABLE IF NOT EXISTS `zyt_account_cost` (
`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_cost_date` (`cost_date`),
UNIQUE KEY `uk_cost_date_channel_dept` (`cost_date`, `media_channel_code`, `dept_id`),
KEY `idx_cost_date_channel_dept` (`cost_date`, `media_channel_code`, `dept_id`),
KEY `idx_update_time` (`update_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户消耗表';