-- ----------------------------
-- Table structure for qimall_addons_xhs_all_statistics
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_all_statistics`;
CREATE TABLE `qimall_addons_xhs_all_statistics`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `push_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发布量',
  `views_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览量',
  `stars_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞量',
  `shares_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享量',
  `discuss_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论量',
  `goods_views_count` int(11) NULL DEFAULT 0 COMMENT '商品访问统计',
  `order_count` int(11) NULL DEFAULT 0 COMMENT '订单统计',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  `goods_amount` decimal(11, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '成交金额',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书汇总统计' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_cate
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_cate`;
CREATE TABLE `qimall_addons_xhs_cate`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `sort` int(10) UNSIGNED NOT NULL DEFAULT 99 COMMENT '序号',
  `name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类名称',
  `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '-1是删除，0是禁用，1是启用',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书分类' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_comment
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_comment`;
CREATE TABLE `qimall_addons_xhs_comment`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城id',
  `user_id` int(10) UNSIGNED NOT NULL COMMENT '用户id',
  `content_id` int(10) UNSIGNED NOT NULL COMMENT '评论的种草 id',
  `content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '评论内容，保存的时候使用 json_encode 编码，拿出来的时候需要 json_decode 解码，防止评论内容中夹带表情时出错',
  `score` tinyint(4) NOT NULL DEFAULT 0 COMMENT '评分',
  `is_anonymous` tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否匿名，1：是，0：不是',
  `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '-1是删除，0是禁用 1是启用',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID',
  INDEX `user_id`(`user_id`) USING BTREE COMMENT '用户ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书评论表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_content
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_content`;
CREATE TABLE `qimall_addons_xhs_content`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
  `cate_id` int(11) NOT NULL COMMENT '内容所属的分类的id',
  `views_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览数',
  `stars_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞数',
  `shares_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '被分享数',
  `discuss_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论数',
  `order_count` int(11) NULL DEFAULT 0 COMMENT '订单数',
  `bought_count` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '购买量',
  `goods_amount` decimal(11, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '成交金额',
  `goods_views_count` int(11) NULL DEFAULT 0 COMMENT '商品浏览数量',
  `content_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '内容类型，1：图片+文字，2：视频+文字',
  `check_status` tinyint(4) NOT NULL DEFAULT 2 COMMENT '内容状态，1：在审核中，2：审核通过，3：审核未通过',
  `check_time` int(11) NULL DEFAULT NULL COMMENT '审核是时间',
  `check_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审核原因',
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标题',
  `main_text` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '正文',
  `time_length` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '视频时长，单位 秒，如果是图文，时长为 0',
  `source` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '此字段保存资源相关的数据，即图片或者视频的保存路径。数据保存的结构形式如，[{url: \"/path/to/11.mp4\", front_cover: \"/path/to/11.jpg\"}].其中 url 的值是图片或者视频的保存路径， front_cover 是封面图片的保存路径',
  `status` tinyint(4) NULL DEFAULT 1 COMMENT '状态，-1是删除，0是禁用，1是启用',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新ID',
  `video_wide` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '视频宽',
  `video_long` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '视频长',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `stars_count`(`stars_count`) USING BTREE COMMENT '点赞范围',
  INDEX `goods_amount`(`goods_amount`) USING BTREE COMMENT '商品访问',
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID',
  INDEX `user_id`(`user_id`) USING BTREE COMMENT '用户ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书素材发布表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_goods_statistics
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_goods_statistics`;
CREATE TABLE `qimall_addons_xhs_goods_statistics`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `goods_id` int(10) UNSIGNED NOT NULL COMMENT '商品 id',
  `order_num` int(11) NOT NULL DEFAULT 0 COMMENT '订单数量',
  `total_amount` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品总金额',
  `goods_views_count` int(11) NULL DEFAULT 0 COMMENT '商品访问量',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `bought_count` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '购买量',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID',
  INDEX `total_amount`(`total_amount`) USING BTREE COMMENT '金额排行'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '商品统计表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_goods_visit
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_goods_visit`;
CREATE TABLE `qimall_addons_xhs_goods_visit`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `content_id` int(10) UNSIGNED NOT NULL COMMENT '内容 id',
  `goods_id` int(10) UNSIGNED NOT NULL COMMENT '商品 id',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID',
  INDEX `user_id`(`user_id`) USING BTREE COMMENT '用户ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_statistics
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_statistics`;
CREATE TABLE `qimall_addons_xhs_statistics`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(10) UNSIGNED NOT NULL COMMENT '商城ID',
  `push_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发布量',
  `views_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '浏览量',
  `stars_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '点赞量',
  `shares_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分享量',
  `discuss_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '评论量',
  `goods_views_count` int(11) NULL DEFAULT 0 COMMENT '商品访问统计',
  `order_count` int(11) NULL DEFAULT 0 COMMENT '订单统计',
  `created_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  `goods_amount` decimal(11, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '成交金额',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书每天统计' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_xhs_user_like
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_xhs_user_like`;
CREATE TABLE `qimall_addons_xhs_user_like`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
  `content_id` int(11) NOT NULL DEFAULT 0 COMMENT '动态ID',
  `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
  `is_likes` tinyint(2) NOT NULL DEFAULT 0 COMMENT '是否点赞，1：是，0：不是',
  `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `mall_id`(`mall_id`) USING BTREE COMMENT '商城ID',
  INDEX `user_id`(`user_id`) USING BTREE COMMENT '用户ID'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小红书用户喜欢统计' ROW_FORMAT = DYNAMIC;

