-- ----------------------------
-- Table structure for qimall_addons_material
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_material`;
CREATE TABLE `qimall_addons_material`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `mall_id` int(11) NOT NULL COMMENT '商城ID',
  `user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
  `user_avatar_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布者头像',
  `user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布者',
  `create_type` tinyint(1) NOT NULL DEFAULT 2 COMMENT '创建类型：1-用户；2-平台；',
  `virtual_download_num` int(11) NULL DEFAULT 0 COMMENT '虚拟下载次数',
  `download_num` int(11) NULL DEFAULT 0 COMMENT '实际下载次数',
  `download_type` tinyint(1) NOT NULL COMMENT '上传类型：1-图文；2-短视频',
  `cate_id` int(11) NOT NULL COMMENT '素材分类id',
  `describe` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ' 素材 文案',
  `goods_id` int(11) NULL DEFAULT NULL COMMENT '关联商品',
  `pic_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '图片集合',
  `thumb_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT '视频封面',
  `video_url` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '视频集合',
  `sort` int(10) NULL DEFAULT 0 COMMENT '排序(越大排越前)',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `check_status` tinyint(1) NULL DEFAULT 1 COMMENT '审核状态：0：未审核 1：审核通过 2：审核不通过',
  `created_at` int(11) NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NULL DEFAULT 0 COMMENT '更新时间',
  `check_at` int(11) NULL DEFAULT NULL COMMENT '审核时间',
  `status` tinyint(4) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '朋友圈素材表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_material_cate
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_material_cate`;
CREATE TABLE `qimall_addons_material_cate`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL COMMENT '商城模块id',
  `name` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类名称',
  `sort` int(5) NULL DEFAULT 99 COMMENT '排序，越小越前面',
  `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NULL DEFAULT 0 COMMENT '更新时间',
  `status` tinyint(4) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '朋友圈素材分类表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_material_download
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_material_download`;
CREATE TABLE `qimall_addons_material_download`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL COMMENT '商户ID',
  `user_id` int(11) NOT NULL COMMENT '下载素材的用户id',
  `material_id` int(11) NOT NULL COMMENT '素材id',
  `status` tinyint(4) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  `created_at` int(11) NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '朋友圈素材下载表' ROW_FORMAT = DYNAMIC;

