Files
cai-server/doc/20251211.sql
2025-12-11 17:27:08 +08:00

34 lines
2.1 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CREATE TABLE `cai_draw_sku_info`
(
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '子账户ID',
`sku_type` tinyint not null comment '奖品类型',
`sku_price` bigint(20) not null default 0 comment '奖品价值估算',
`sku_name` varchar(255) not null comment '奖品名称',
`auto_give` tinyint not null default 0 comment '是否自动兑奖',
`usercode` varchar(100) NOT NULL COMMENT '用户',
`message` varchar(100) NOT NULL COMMENT '账户明细说明',
`action_type` varchar(36) DEFAULT NULL COMMENT '触发来源 1-充值 2-分销 3-抽奖',
`tar_user_id` bigint DEFAULT NULL COMMENT '目标ID用户、抽奖ID',
`tar_usercode` varchar(20) DEFAULT NULL COMMENT '目标用户Code有用户才有用',
`tar_name` varchar(255) DEFAULT NULL COMMENT '目标名称,用户名称,抽奖名称',
`tar_price` bigint DEFAULT NULL COMMENT '礼物价值',
`tar_img` varchar(255) DEFAULT NULL COMMENT '目标提前缓存的',
`tar_json` JSON DEFAULT NULL COMMENT '目标额外字段',
`change_value` bigint NOT NULL DEFAULT '0.00' COMMENT '变化值,为正 或者为负',
`operate_ip` varchar(15) DEFAULT '' COMMENT '操作IP',
`is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否为后台用户手动调整',
`trace_link_type` varchar(36) DEFAULT NULL COMMENT '跟踪类型 1-充值 2-分销 3-抽奖',
`trace_id` varchar(50) DEFAULT NULL COMMENT '跟踪ID 订单号-礼物ID',
`give_flag` tinyint NOT NULL DEFAULT '0' COMMENT '是否兑换',
`give_time` datetime comment '兑换时间',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id` (`user_id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
ROW_FORMAT = DYNAMIC COMMENT ='抽奖奖池';