-- ----------------------------
-- Table structure for qimall_addons_sudoku
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_sudoku`;
CREATE TABLE `qimall_addons_sudoku`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL COMMENT '商城ID',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '别名',
  `type` int(11) NULL DEFAULT NULL COMMENT '1.红包2.优惠卷3.积分4.实物.5.无',
  `goods_id` int(11) NULL DEFAULT 0 COMMENT '商品',
  `score` decimal(11, 2) NULL DEFAULT 0.00 COMMENT '积分',
  `red_packet_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '红包价格',
  `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '图片',
  `coupon_id` int(11) NULL DEFAULT 0 COMMENT '优惠券',
  `stock` int(11) NULL DEFAULT 0 COMMENT '库存',
  `amount` int(11) NULL DEFAULT NULL COMMENT '金额',
  `probability` float(11, 4) NULL DEFAULT 0.0000 COMMENT '概率',
  `prize_id` int(11) NULL DEFAULT NULL COMMENT '奖品ID',
  `created_at` int(11) NOT NULL COMMENT '创建时间',
  `updated_at` int(11) NULL DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = Innodb CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '九宫格奖品配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for qimall_addons_sudoku_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_sudoku_log`;
CREATE TABLE `qimall_addons_sudoku_log`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
  `sudoku_id` int(11) NULL DEFAULT NULL COMMENT '九宫格奖品ID',
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `status` int(11) NOT NULL DEFAULT 0 COMMENT ' 0未领取1 已领取',
  `type` int(11) NOT NULL COMMENT '1.红包2.优惠卷3.积分4.实物5无',
  `coupon_id` int(11) NULL DEFAULT NULL COMMENT '优惠券ID',
  `goods_id` int(11) NULL DEFAULT 0 COMMENT '商品id',
  `order_id` int(11) NOT NULL DEFAULT 0 COMMENT '主订单ID',
  `receive_at` int(11) NULL DEFAULT 0 COMMENT '领取时间',
  `created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `updated_at` int(11) NULL DEFAULT NULL COMMENT '更新时间',
  `score` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '积分',
  `red_packet_amount` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = Innodb CHARACTER SET = utf8 COLLATE = utf8_unicode_ci COMMENT = '九宫格抽奖记录表';

