-- ----------------------------
-- Table structure for kx_user_task
-- ----------------------------
DROP TABLE IF EXISTS `kx_user_task`;
CREATE TABLE `kx_user_task`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务名称',
  `real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '配置原名',
  `task_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务类型',
  `number` int(11) NOT NULL DEFAULT 0 COMMENT '限定数',
  `level_id` int(11) NOT NULL DEFAULT 0 COMMENT '等级id',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示',
  `is_must` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否务必达成任务,1务必达成,0=满足其一',
  `illustrate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '任务说明',
  `create_time` datetime(0) NOT NULL COMMENT '新增时间',
  `update_time` datetime(0) NULL DEFAULT NULL,
  `is_del` tinyint(1) NULL DEFAULT 0,
  `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '等级任务设置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of kx_user_task
-- ----------------------------
INSERT INTO `kx_user_task` VALUES (1, '满足积分20分', '积分数', 'SatisfactionIntegral', 20, 1, 0, 1, 1, '', '2020-06-25 18:54:35', '2020-06-25 18:54:35', 0, NULL, NULL);
INSERT INTO `kx_user_task` VALUES (2, '消费满100元', '消费金额', 'ConsumptionAmount', 100, 1, 0, 1, 1, '', '2020-06-25 18:54:35', NULL, 0, NULL, NULL);
INSERT INTO `kx_user_task` VALUES (3, '满足积分200分', '积分数', 'SatisfactionIntegral', 200, 2, 0, 1, 1, '', '2020-06-25 18:54:35', NULL, 0, NULL, NULL);
INSERT INTO `kx_user_task` VALUES (4, '累计签到20天', '累计签到', 'CumulativeAttendance', 20, 2, 0, 1, 1, '', '2020-06-25 18:54:35', NULL, 0, NULL, NULL);
INSERT INTO `kx_user_task` VALUES (16, '累计签到2天', '累计签到', 'CumulativeAttendance', 2, 1, 0, 1, 1, '', '2020-06-25 18:54:35', NULL, 0, NULL, NULL);
INSERT INTO `kx_user_task` VALUES (17, '消费满100元', '消费次数', 'ConsumptionAmount', 100, 2, 0, 1, 1, '', '2020-06-25 18:54:35', NULL, 0, NULL, NULL);

-- ----------------------------
-- Table structure for kx_user_task_finish
-- ----------------------------
DROP TABLE IF EXISTS `kx_user_task_finish`;
CREATE TABLE `kx_user_task_finish`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `task_id` int(11) NOT NULL DEFAULT 0 COMMENT '任务id',
  `uid` bigint(20) NOT NULL DEFAULT 0 COMMENT '用户id',
  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否有效',
  `create_time` datetime(0) NOT NULL COMMENT '添加时间',
  `update_time` datetime(0) NULL DEFAULT NULL,
  `is_del` tinyint(1) NULL DEFAULT 0,
  `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户任务完成记录表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for kx_user_level
-- ----------------------------
DROP TABLE IF EXISTS `kx_user_level`;
CREATE TABLE `kx_user_level`  (
                                  `id` int(11) NOT NULL AUTO_INCREMENT,
                                  `uid` bigint(20) NOT NULL DEFAULT 0 COMMENT '用户uid',
                                  `level_id` int(11) NOT NULL DEFAULT 0 COMMENT '等级vip',
                                  `grade` int(11) NOT NULL DEFAULT 0 COMMENT '会员等级',
                                  `valid_time` int(11) NOT NULL DEFAULT 0 COMMENT '过期时间',
                                  `is_forever` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否永久',
                                  `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id',
                                  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0:禁止,1:正常',
                                  `mark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注',
                                  `remind` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已通知',
                                  `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除,0=未删除,1=删除',
                                  `create_time` datetime(0) NOT NULL COMMENT '添加时间',
                                  `update_time` datetime(0) NULL DEFAULT NULL,
                                  `discount` int(11) NOT NULL DEFAULT 0 COMMENT '享受折扣',
                                  `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
                                  `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人',
                                  PRIMARY KEY (`id`) USING BTREE,
                                  UNIQUE INDEX `id`(`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户等级记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for kx_user_level_setting
-- ----------------------------
DROP TABLE IF EXISTS `kx_user_level_setting`;
CREATE TABLE `kx_user_level_setting`  (
                                          `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                          `mer_id` int(11) NOT NULL DEFAULT 0 COMMENT '商户id',
                                          `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员名称',
                                          `money` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '购买金额',
                                          `valid_date` int(11) NOT NULL DEFAULT 0 COMMENT '有效时间',
                                          `is_forever` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否为永久会员',
                                          `is_pay` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否购买,1=购买,0=不购买',
                                          `is_show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示 1=显示,0=隐藏',
                                          `grade` int(11) NOT NULL DEFAULT 0 COMMENT '会员等级',
                                          `discount` decimal(8, 2) NOT NULL COMMENT '享受折扣',
                                          `image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员卡背景',
                                          `icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员图标',
                                          `explain` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '说明',
                                          `create_time` datetime(0) NOT NULL COMMENT '添加时间',
                                          `update_time` datetime(0) NULL DEFAULT NULL,
                                          `is_del` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除.1=删除,0=未删除',
                                          `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
                                          `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新人',
                                          PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '设置用户等级表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of kx_user_level_setting
-- ----------------------------
INSERT INTO `kx_user_level_setting` VALUES (1, 0, '普通会员', 20.00, 0, 1, 0, 1, 1, 99.00, '[{\"ossId\":\"1708811387525591041\",\"url\":\"http://175.178.228.217:9000/kxmall/2023/10/02/c62b1d31f95446b99fbdbb939e762331.jpg\"}]', '[{\"ossId\":\"1708811650953048065\",\"url\":\"http://175.178.228.217:9000/kxmall/2023/10/02/e877003e09d34cd4a211a1a700a7e587.png\"}]', '普通会员', '2020-06-25 18:54:35', '2023-10-02 19:50:22', 0, NULL, 'admin');
INSERT INTO `kx_user_level_setting` VALUES (2, 0, '青铜会员', 0.00, 0, 1, 0, 1, 2, 98.00, '[{\"ossId\":\"1708811492097978369\",\"url\":\"http://175.178.228.217:9000/kxmall/2023/10/02/8c6d3253a47f4cfe9582ae1b139d1f70.jpg\"}]', '[{\"ossId\":\"1708811699430813698\",\"url\":\"http://175.178.228.217:9000/kxmall/2023/10/02/7d4872a48d5e46ce9267def14600809f.png\"}]', '青铜会员', '2020-06-25 18:54:35', '2023-10-02 19:50:34', 0, NULL, 'admin');