💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
```[sql] CREATE TABLE ns_coupon ( coupon_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券id', coupon_type_id INT(11) NOT NULL COMMENT '优惠券类型id', shop_id INT(11) NOT NULL COMMENT '店铺Id', coupon_code VARCHAR(255) NOT NULL DEFAULT '' COMMENT '优惠券编码', uid INT(11) NOT NULL DEFAULT 0 COMMENT '领用人', use_order_id INT(11) NOT NULL DEFAULT 0 COMMENT '优惠券使用订单id', create_order_id INT(11) NOT NULL DEFAULT 0 COMMENT '创建订单id(优惠券只有是完成订单发放的优惠券时才有值)', money DECIMAL(10, 2) NOT NULL COMMENT '面额', state TINYINT(4) NOT NULL DEFAULT 0 COMMENT '优惠券状态 0未领用 1已领用(未使用) 2已使用 3已过期', get_type INT(11) NOT NULL DEFAULT 0 COMMENT '获取方式1订单2.首页领取', fetch_time INT(11) DEFAULT 0 COMMENT '领取时间', use_time INT(11) DEFAULT 0 COMMENT '使用时间', start_time INT(11) DEFAULT 0 COMMENT '有效期开始时间', end_time INT(11) DEFAULT 0 COMMENT '有效期结束时间', PRIMARY KEY (coupon_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 148 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '优惠券表'; CREATE TABLE ns_coupon_goods ( id INT(11) NOT NULL AUTO_INCREMENT, coupon_type_id INT(11) NOT NULL COMMENT '优惠券类型id', goods_id INT(11) NOT NULL COMMENT '商品id', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 606 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '优惠券使用商品表'; CREATE TABLE ns_coupon_type ( coupon_type_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '优惠券类型Id', shop_id INT(11) NOT NULL DEFAULT 1 COMMENT '店铺ID', coupon_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '优惠券名称', money DECIMAL(10, 2) NOT NULL COMMENT '发放面额', count INT(11) NOT NULL COMMENT '发放数量', max_fetch INT(11) NOT NULL DEFAULT 0 COMMENT '每人最大领取个数 0无限制', at_least DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '满多少元使用 0代表无限制', need_user_level TINYINT(4) NOT NULL DEFAULT 0 COMMENT '领取人会员等级', range_type TINYINT(4) NOT NULL DEFAULT 1 COMMENT '使用范围0部分产品使用 1全场产品使用', is_show INT(11) NOT NULL DEFAULT 0 COMMENT '是否允许首页显示0不显示1显示', start_time INT(11) DEFAULT 0 COMMENT '有效日期开始时间', end_time INT(11) DEFAULT 0 COMMENT '有效日期结束时间', create_time INT(11) DEFAULT 0 COMMENT '创建时间', update_time INT(11) DEFAULT 0 COMMENT '修改时间', term_of_validity_type INT(1) NOT NULL DEFAULT 0 COMMENT '有效期类型 0固定时间 1领取之日起', fixed_term INT(3) NOT NULL DEFAULT 1 COMMENT '领取之日起N天内有效', get_num INT(11) NOT NULL DEFAULT 0 COMMENT '已领取数量', is_end INT(11) NOT NULL DEFAULT 0 COMMENT '是否已经领取完', status INT(11) NOT NULL DEFAULT 0 COMMENT '优惠券状态(0、正常 1、已发完 2、已关闭)', PRIMARY KEY (coupon_type_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1365 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '优惠券类型表'; CREATE TABLE ns_gift_grant_records ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', gift_id INT(11) NOT NULL COMMENT '赠送活动ID', goods_id INT(11) NOT NULL COMMENT '赠送商品ID', goods_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '赠送商品名称', goods_img VARCHAR(255) NOT NULL DEFAULT '' COMMENT '赠送商品图片', num INT(11) NOT NULL DEFAULT 1 COMMENT '赠送数量', type INT(11) NOT NULL DEFAULT 1 COMMENT '发放方式', type_id INT(11) NOT NULL DEFAULT 0 COMMENT '发放相关ID', memo TEXT NOT NULL COMMENT '备注', create_time INT(11) DEFAULT 0 COMMENT '赠送时间', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '赠品发放记录'; CREATE TABLE ns_point_config ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', shop_id INT(11) NOT NULL COMMENT '店铺ID', is_open TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否启动', convert_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '1积分对应金额', `desc` TEXT NOT NULL COMMENT '积分说明', create_time INT(11) DEFAULT 0 COMMENT '创建时间', modify_time INT(11) DEFAULT 0 COMMENT '修改时间', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '积分设置表'; -- -- Definition for table ns_promotion_bargain -- DROP TABLE IF EXISTS ns_promotion_bargain; CREATE TABLE ns_promotion_bargain ( bargain_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', bargain_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '活动名称', shop_id INT(10) NOT NULL DEFAULT 0 COMMENT '店铺编号', shop_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '店铺名称', status TINYINT(1) NOT NULL DEFAULT 0 COMMENT '活动状态(0-未发布/1-正常/3-关闭/4-结束)', remark VARCHAR(200) NOT NULL DEFAULT '' COMMENT '备注', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动结束时间', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间', modify_time INT(11) NOT NULL DEFAULT 0 COMMENT '修改时间', bargain_min_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '可砍到商品价格最低比例', bargain_min_number INT(11) NOT NULL DEFAULT 0 COMMENT '最少需要砍到的次数', one_min_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '自己砍的最低价格的百分比', one_max_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '自己砍的最高价格的百分比', PRIMARY KEY (bargain_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '砍价活动表'; -- -- Definition for table ns_promotion_bargain_goods -- DROP TABLE IF EXISTS ns_promotion_bargain_goods; CREATE TABLE ns_promotion_bargain_goods ( bargain_goods_id INT(11) NOT NULL AUTO_INCREMENT, bargain_id INT(11) NOT NULL DEFAULT 0 COMMENT '活动id', goods_id INT(11) NOT NULL DEFAULT 0 COMMENT '商品id', goods_name VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商品名称', goods_picture VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品图片', status TINYINT(4) NOT NULL DEFAULT 0 COMMENT '活动状态', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '结束时间', fictitious_sales INT(11) NOT NULL DEFAULT 0 COMMENT '虚拟销量', sales INT(11) NOT NULL DEFAULT 0 COMMENT '真实销量', partake_number INT(11) NOT NULL DEFAULT 0 COMMENT '参与人数', bargain_min_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '可砍到最低价格百分比', one_min_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '自己砍的最低价格的百分比', one_max_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '自己砍的最高价格的百分比', bargain_min_number INT(11) NOT NULL DEFAULT 0 COMMENT '最少需要砍到的次数', PRIMARY KEY (bargain_goods_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '砍价商品表'; -- -- Definition for table ns_promotion_bargain_launch -- DROP TABLE IF EXISTS ns_promotion_bargain_launch; CREATE TABLE ns_promotion_bargain_launch ( launch_id INT(11) NOT NULL AUTO_INCREMENT, uid INT(11) NOT NULL DEFAULT 0 COMMENT '发起人', bargain_id INT(11) NOT NULL DEFAULT 0 COMMENT '活动id', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '发起时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '结束时间', receiver_mobile VARCHAR(11) NOT NULL DEFAULT '' COMMENT '收货人的手机号码', receiver_province INT(11) NOT NULL COMMENT '收货人所在省', receiver_city INT(11) NOT NULL COMMENT '收货人所在城市', receiver_district INT(11) NOT NULL COMMENT '收货人所在街道', receiver_address VARCHAR(255) NOT NULL DEFAULT '' COMMENT '收货人详细地址', receiver_zip VARCHAR(6) NOT NULL DEFAULT '' COMMENT '收货人邮编', receiver_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '收货人姓名', goods_money DECIMAL(19, 2) NOT NULL DEFAULT 0.00 COMMENT '商品价格', bargain_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '砍价金额', surplus_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '剩余金额', partake_number INT(11) NOT NULL DEFAULT 0 COMMENT '参与人数', status INT(11) NOT NULL DEFAULT 1 COMMENT '状态 1活动时间 2活动结束 -1取消', sku_id INT(11) NOT NULL DEFAULT 0 COMMENT '商品规格id', bargain_min_number INT(11) NOT NULL DEFAULT 0 COMMENT '最少需要砍到的次数', order_id INT(11) NOT NULL DEFAULT 0 COMMENT '订单id', bargain_min_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '可砍到的最低金额', goods_id INT(11) NOT NULL DEFAULT 0 COMMENT '商品id', shipping_type INT(1) NOT NULL DEFAULT 1 COMMENT '配送方式 1物流配送 2自提配送', pick_up_id INT(11) NOT NULL DEFAULT 0 COMMENT '自提点id', bargain_status TINYINT(1) NOT NULL DEFAULT 0 COMMENT '有没有返回库存 0 (没有) 1(以反)', PRIMARY KEY (launch_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1820 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '砍价发起表'; -- -- Definition for table ns_promotion_bargain_partake -- DROP TABLE IF EXISTS ns_promotion_bargain_partake; CREATE TABLE ns_promotion_bargain_partake ( partake_id INT(11) NOT NULL AUTO_INCREMENT, launch_id INT(11) NOT NULL DEFAULT 0 COMMENT '发起砍价的id', uid INT(11) NOT NULL DEFAULT 0 COMMENT '参与人', bargain_money DECIMAL(19, 2) NOT NULL DEFAULT 0.00 COMMENT '砍掉的金额', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '参与时间', partake_json VARCHAR(255) NOT NULL DEFAULT '' COMMENT '参与人的基础信息', remark VARCHAR(255) NOT NULL DEFAULT '' COMMENT '说明', PRIMARY KEY (partake_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 364 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '砍价参与表'; -- -- Definition for table ns_promotion_bundling -- DROP TABLE IF EXISTS ns_promotion_bundling; CREATE TABLE ns_promotion_bundling ( bl_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '组合ID', bl_name VARCHAR(50) NOT NULL COMMENT '组合名称', shop_id INT(11) NOT NULL COMMENT '店铺id', shop_name VARCHAR(100) NOT NULL COMMENT '店铺名称', bl_price DECIMAL(10, 2) NOT NULL COMMENT '商品组合价格', shipping_fee_type TINYINT(1) NOT NULL COMMENT '运费承担方式 1卖家承担运费 2买家承担运费', shipping_fee DECIMAL(10, 2) NOT NULL COMMENT '运费', status TINYINT(1) NOT NULL DEFAULT 1 COMMENT '组合状态 0-关闭/1-开启', PRIMARY KEY (bl_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '组合销售活动表'; -- -- Definition for table ns_promotion_bundling_goods -- DROP TABLE IF EXISTS ns_promotion_bundling_goods; CREATE TABLE ns_promotion_bundling_goods ( bl_goods_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '组合商品id', bl_id INT(11) NOT NULL COMMENT '组合id', goods_id INT(10) UNSIGNED NOT NULL COMMENT '商品id', goods_name VARCHAR(50) NOT NULL COMMENT '商品名称', goods_picture VARCHAR(100) NOT NULL COMMENT '商品图片', bl_goods_price DECIMAL(10, 2) NOT NULL COMMENT '商品组合价格', sort INT(11) DEFAULT NULL, PRIMARY KEY (bl_goods_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '组合销售活动商品表'; -- -- Definition for table ns_promotion_discount -- DROP TABLE IF EXISTS ns_promotion_discount; CREATE TABLE ns_promotion_discount ( discount_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', shop_id INT(11) NOT NULL DEFAULT 1 COMMENT '店铺ID', shop_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '店铺名称', discount_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动名称', status TINYINT(1) NOT NULL DEFAULT 0 COMMENT '活动状态(0-未发布/1-正常/3-关闭/4-结束)', remark TEXT NOT NULL COMMENT '备注', start_time INT(11) DEFAULT 0 COMMENT '开始时间', end_time INT(11) DEFAULT 0 COMMENT '结束时间', create_time INT(11) DEFAULT 0 COMMENT '创建时间', modify_time INT(11) DEFAULT 0 COMMENT '修改时间', decimal_reservation_number INT(2) NOT NULL DEFAULT 2 COMMENT '价格保留方式 0 去掉角和分,1去掉分,2 保留角和分', PRIMARY KEY (discount_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 4096 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '限时折扣'; -- -- Definition for table ns_promotion_discount_goods -- DROP TABLE IF EXISTS ns_promotion_discount_goods; CREATE TABLE ns_promotion_discount_goods ( discount_goods_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', discount_id INT(11) NOT NULL COMMENT '对应活动', goods_id INT(11) NOT NULL COMMENT '商品ID', status TINYINT(1) NOT NULL DEFAULT 0 COMMENT '状态', discount DECIMAL(10, 2) NOT NULL COMMENT '活动折扣或者减现信息', goods_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品名称', goods_picture INT(11) NOT NULL COMMENT '商品图片', start_time INT(11) DEFAULT 0 COMMENT '开始时间', end_time INT(11) DEFAULT 0 COMMENT '结束时间', decimal_reservation_number INT(2) NOT NULL DEFAULT 2 COMMENT '价格保留方式 0 去掉角和分,1去掉分,2 保留角和分', PRIMARY KEY (discount_goods_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 712 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '限时折扣商品列表'; -- -- Definition for table ns_promotion_full_mail -- DROP TABLE IF EXISTS ns_promotion_full_mail; CREATE TABLE ns_promotion_full_mail ( mail_id INT(11) NOT NULL AUTO_INCREMENT, shop_id INT(11) NOT NULL DEFAULT 0 COMMENT '店铺id', is_open TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否开启 0未开启 1已开启', full_mail_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '包邮所需订单金额', create_time INT(11) DEFAULT 0 COMMENT '创建时间', modify_time INT(11) DEFAULT 0 COMMENT '更新时间', no_mail_province_id_array TEXT NOT NULL COMMENT '不包邮省id组', no_mail_city_id_array TEXT NOT NULL COMMENT '不包邮市id组', PRIMARY KEY (mail_id) ) ENGINE = INNODB AUTO_INCREMENT = 2 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '满额包邮'; -- -- Definition for table ns_promotion_game_rule -- DROP TABLE IF EXISTS ns_promotion_game_rule; CREATE TABLE ns_promotion_game_rule ( rule_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '规则id', game_id INT(11) NOT NULL DEFAULT 0 COMMENT '游戏id', rule_num INT(11) NOT NULL DEFAULT 0 COMMENT '奖品数量', type INT(11) NOT NULL DEFAULT 1 COMMENT '奖励类型1. 积分 2. 优惠券3.红包4.赠品...', coupon_type_id INT(11) NOT NULL DEFAULT 0 COMMENT '优惠券类型id', points INT(11) NOT NULL DEFAULT 0 COMMENT '奖励积分数', hongbao DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '奖励红包数', gift_id INT(11) NOT NULL DEFAULT 0 COMMENT '赠品id', remark VARCHAR(255) NOT NULL DEFAULT '' COMMENT '规则关键字', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间', rule_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '奖励规则等级', type_value VARCHAR(255) NOT NULL DEFAULT '' COMMENT '奖励的具体的对应信息名称', remaining_number INT(11) DEFAULT 0 COMMENT '剩余奖品数量', PRIMARY KEY (rule_id), INDEX IDX_ns_promotion_game_rule_coupon_type_id (coupon_type_id), INDEX IDX_ns_promotion_game_rule_game_id (game_id), INDEX IDX_ns_promotion_game_rule_type (type) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 3276 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '游戏活动规则'; -- -- Definition for table ns_promotion_game_type -- DROP TABLE IF EXISTS ns_promotion_game_type; CREATE TABLE ns_promotion_game_type ( game_type INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, type_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '类型名称', type_image VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动类型默认背景图', type_ico VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动小图标', type_des VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动介绍', sort INT(11) NOT NULL DEFAULT 0 COMMENT '排序', is_complete INT(11) NOT NULL DEFAULT 0 COMMENT '是否完成', game_text TEXT NOT NULL, PRIMARY KEY (game_type) ) ENGINE = INNODB AUTO_INCREMENT = 11 AVG_ROW_LENGTH = 1638 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '营销游戏类型'; -- -- Definition for table ns_promotion_games -- DROP TABLE IF EXISTS ns_promotion_games; CREATE TABLE ns_promotion_games ( game_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '游戏id', shop_id INT(11) NOT NULL DEFAULT 0 COMMENT '店铺id', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '游戏活动名称', game_type INT(11) NOT NULL DEFAULT 1 COMMENT '游戏类型', member_level VARCHAR(255) NOT NULL DEFAULT '0' COMMENT '参与的会员等级0表示全部参与', level_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '参与活动会员名称', points INT(11) NOT NULL DEFAULT 0 COMMENT '参与一次扣除积分', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动结束时间', status INT(11) NOT NULL DEFAULT 0 COMMENT '活动状态 0未开始 1已开始 -1已结束 -2已关闭', remark VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '活动说明', winning_rate DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '中奖率', no_winning_des VARCHAR(255) NOT NULL DEFAULT '' COMMENT '未中奖说明', activity_images VARCHAR(255) DEFAULT '' COMMENT '活动图片,只有上传了活动图,才会在首页显示', winning_list_display INT(11) NOT NULL DEFAULT 0 COMMENT '中奖名单是否显示 0不显示 1显示', join_type INT(11) NOT NULL DEFAULT 0 COMMENT '参加类型 0 次/活动全过程 1 次/每天', join_frequency INT(11) NOT NULL DEFAULT 1 COMMENT '根据类型计算参加次数', winning_type INT(11) NOT NULL DEFAULT 0 COMMENT '中奖类型 0 次/活动全过程 1 次/每天', winning_max INT(11) NOT NULL DEFAULT 1 COMMENT '根据类型计算中奖最大限制', is_index_show INT(11) NOT NULL COMMENT '是否在主页显示', PRIMARY KEY (game_id), INDEX IDX_ns_promotion_games_end_time (end_time), INDEX IDX_ns_promotion_games_start_time (start_time), INDEX IDX_ns_promotion_games_status (status), INDEX IDX_ns_promotion_games_type (game_type) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '营销游戏(概率游戏)'; -- -- Definition for table ns_promotion_games_winning_records -- DROP TABLE IF EXISTS ns_promotion_games_winning_records; CREATE TABLE ns_promotion_games_winning_records ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, uid VARCHAR(255) NOT NULL DEFAULT '0' COMMENT '会员id', shop_id INT(11) NOT NULL DEFAULT 0 COMMENT '店铺id', is_use INT(11) NOT NULL DEFAULT 0 COMMENT '是否使用', game_id INT(11) NOT NULL DEFAULT 0 COMMENT '活动id', game_type INT(11) NOT NULL DEFAULT 1 COMMENT '游戏类型1.大转盘2.刮刮乐3.九宫格', type INT(11) NOT NULL DEFAULT 1 COMMENT '奖励类型1.积分2.优惠券3.红包4.赠品...', points DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '奖励积分', hongbao DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '红包数(余额)', coupon_id INT(11) NOT NULL DEFAULT 0 COMMENT '奖励优惠券', gift_id INT(11) NOT NULL DEFAULT 0 COMMENT '赠品id', remark VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '说明', is_winning SMALLINT(1) NOT NULL DEFAULT 0 COMMENT '该次是否中奖 0未中奖 1中奖', nick_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '会员昵称', add_time INT(11) NOT NULL DEFAULT 0 COMMENT '添加时间', rule_id INT(11) NOT NULL DEFAULT 0 COMMENT '奖项id', associated_gift_record_id INT(11) DEFAULT 0 COMMENT '关联赠品记录id', PRIMARY KEY (id), INDEX IDX_ns_promotion_games_winning_records_coupon_id (coupon_id), INDEX IDX_ns_promotion_games_winning_records_game_id (game_id), INDEX IDX_ns_promotion_games_winning_records_gift_id (gift_id), INDEX IDX_ns_promotion_games_winning_records_type (type) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 169 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '获奖记录'; -- -- Definition for table ns_promotion_gift -- DROP TABLE IF EXISTS ns_promotion_gift; CREATE TABLE ns_promotion_gift ( gift_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '赠品活动id ', days INT(10) UNSIGNED NOT NULL COMMENT '领取有效期(多少天)', max_num VARCHAR(50) NOT NULL COMMENT '领取限制(次/人 (0表示不限领取次数))', shop_id VARCHAR(100) NOT NULL COMMENT '店铺id', gift_name VARCHAR(255) NOT NULL COMMENT '赠品活动名称', start_time INT(11) DEFAULT 0 COMMENT '赠品有效期开始时间', end_time INT(11) DEFAULT 0 COMMENT '赠品有效期结束时间', create_time INT(11) DEFAULT 0 COMMENT '创建时间', modify_time INT(11) DEFAULT 0 COMMENT '修改时间', status INT(11) DEFAULT 0 COMMENT '(0未关闭,1已关闭)', PRIMARY KEY (gift_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 8192 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '赠品活动表'; -- -- Definition for table ns_promotion_gift_goods -- DROP TABLE IF EXISTS ns_promotion_gift_goods; CREATE TABLE ns_promotion_gift_goods ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id ', gift_id INT(10) UNSIGNED NOT NULL COMMENT '赠品id ', goods_id INT(10) UNSIGNED NOT NULL COMMENT '商品id', goods_name VARCHAR(50) NOT NULL COMMENT '商品名称', goods_picture VARCHAR(100) NOT NULL COMMENT '商品图片', sku_id INT(11) NOT NULL COMMENT '商品sku_id', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 8192 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '商品赠品表'; -- -- Definition for table ns_promotion_gift_grant_records -- DROP TABLE IF EXISTS ns_promotion_gift_grant_records; CREATE TABLE ns_promotion_gift_grant_records ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, shop_id INT(11) NOT NULL COMMENT '店铺id', uid INT(11) NOT NULL COMMENT '会员id', nick_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '会员昵称', gift_id INT(11) NOT NULL COMMENT '礼品id', gift_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '礼品名称', goods_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品名称', goods_picture INT(11) NOT NULL DEFAULT 0 COMMENT '商品图id', type INT(11) NOT NULL DEFAULT 1 COMMENT '领取类型1.满减2.游戏...', type_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '类型名称', relate_id INT(11) NOT NULL DEFAULT 0 COMMENT '关联id(订单id)', remark VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '备注', create_time INT(11) NOT NULL COMMENT '创建时间', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 2730 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '赠品发放记录'; -- -- Definition for table ns_promotion_group_buy -- DROP TABLE IF EXISTS ns_promotion_group_buy; CREATE TABLE ns_promotion_group_buy ( group_id INT(11) NOT NULL AUTO_INCREMENT, group_name VARCHAR(50) NOT NULL COMMENT '活动名称', shop_id INT(11) NOT NULL DEFAULT 0 COMMENT '店铺id', goods_id INT(11) NOT NULL DEFAULT 0 COMMENT '商品id', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '活动结束时间', max_num INT(11) NOT NULL DEFAULT 0 COMMENT '最大购买量', min_num INT(11) NOT NULL DEFAULT 0 COMMENT '最小购买量', status INT(11) NOT NULL DEFAULT 0 COMMENT '状态', remark VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动信息', create_time INT(11) NOT NULL DEFAULT 0, modify_time INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (group_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '团购活动表'; -- -- Definition for table ns_promotion_group_buy_ladder -- DROP TABLE IF EXISTS ns_promotion_group_buy_ladder; CREATE TABLE ns_promotion_group_buy_ladder ( id INT(11) NOT NULL AUTO_INCREMENT, group_id INT(11) NOT NULL DEFAULT 0 COMMENT '团购id', num INT(11) NOT NULL DEFAULT 0 COMMENT '数量', group_price DECIMAL(19, 2) NOT NULL DEFAULT 0.00 COMMENT '团购价格', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '团购阶梯价'; -- -- Definition for table ns_promotion_mansong -- DROP TABLE IF EXISTS ns_promotion_mansong; CREATE TABLE ns_promotion_mansong ( mansong_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '满送活动编号', mansong_name VARCHAR(50) NOT NULL COMMENT '活动名称', shop_id INT(10) UNSIGNED NOT NULL COMMENT '店铺编号', shop_name VARCHAR(50) NOT NULL COMMENT '店铺名称', status TINYINT(1) UNSIGNED NOT NULL COMMENT '活动状态(0-未发布/1-正常/3-关闭/4-结束)', remark VARCHAR(200) NOT NULL COMMENT '备注', type TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1.普通优惠 2.多级优惠', range_type TINYINT(1) NOT NULL DEFAULT 1 COMMENT '1全部商品 0部分商品', start_time INT(11) DEFAULT 0 COMMENT '活动开始时间', end_time INT(11) DEFAULT 0 COMMENT '活动结束时间', create_time INT(11) DEFAULT 0 COMMENT '创建时间', modify_time INT(11) DEFAULT 0 COMMENT '修改时间', PRIMARY KEY (mansong_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1638 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '满就送活动表'; -- -- Definition for table ns_promotion_mansong_goods -- DROP TABLE IF EXISTS ns_promotion_mansong_goods; CREATE TABLE ns_promotion_mansong_goods ( id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', mansong_id INT(11) NOT NULL COMMENT '满减送ID', goods_id INT(11) NOT NULL COMMENT '商品ID', goods_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '商品名称', goods_picture VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品图片', status TINYINT(4) NOT NULL DEFAULT 0 COMMENT '活动状态', start_time INT(11) DEFAULT 0 COMMENT '开始时间', end_time INT(11) DEFAULT 0 COMMENT '结束时间', PRIMARY KEY (id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1489 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '满减送商品'; -- -- Definition for table ns_promotion_mansong_rule -- DROP TABLE IF EXISTS ns_promotion_mansong_rule; CREATE TABLE ns_promotion_mansong_rule ( rule_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '规则编号', mansong_id INT(10) UNSIGNED NOT NULL COMMENT '活动编号', price DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '级别价格(满多少)', discount DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '减现金优惠金额(减多少金额)', free_shipping TINYINT(4) NOT NULL DEFAULT 0 COMMENT '免邮费', give_point INT(11) NOT NULL DEFAULT 0 COMMENT '送积分数量(0表示不送)', give_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '送优惠券的id(0表示不送)', gift_id INT(11) NOT NULL COMMENT '礼品(赠品)id', PRIMARY KEY (rule_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1170 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '满就送活动规则表'; -- -- Definition for table ns_promotion_topic -- DROP TABLE IF EXISTS ns_promotion_topic; CREATE TABLE ns_promotion_topic ( topic_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键', shop_id INT(11) NOT NULL DEFAULT 1 COMMENT '店铺ID', shop_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '店铺名称', topic_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '活动名称', keyword VARCHAR(500) NOT NULL DEFAULT '' COMMENT '专题关键字', `desc` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '专题描述', picture_img VARCHAR(255) NOT NULL DEFAULT '' COMMENT '图像地址', scroll_img VARCHAR(255) NOT NULL DEFAULT '' COMMENT '条幅图片', background_img VARCHAR(255) NOT NULL DEFAULT '' COMMENT '背景图', background_color VARCHAR(255) NOT NULL DEFAULT '' COMMENT '背景色', introduce TEXT NOT NULL COMMENT '专题介绍', wap_topic_template VARCHAR(255) NOT NULL DEFAULT '' COMMENT '手机自定义模板', pc_topic_template VARCHAR(255) NOT NULL DEFAULT '' COMMENT '电脑端模板', is_head TINYINT(4) NOT NULL DEFAULT 1 COMMENT '是否显示头部0.不显示1.显示', is_foot TINYINT(4) NOT NULL DEFAULT 1 COMMENT '是否显示底部', status TINYINT(4) NOT NULL DEFAULT 0 COMMENT '0-未发布/1-正常/3-关闭/4-结束', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '结束时间', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间', modify_time INT(11) NOT NULL DEFAULT 0 COMMENT '修改时间', PRIMARY KEY (topic_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 4096 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '专题活动表'; -- -- Definition for table ns_promotion_topic_goods -- DROP TABLE IF EXISTS ns_promotion_topic_goods; CREATE TABLE ns_promotion_topic_goods ( topic_goods_id INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键', topic_id INT(11) NOT NULL COMMENT '对应专题活动', goods_id INT(11) NOT NULL COMMENT '商品ID', goods_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品名称', goods_picture INT(11) NOT NULL COMMENT '商品图片', PRIMARY KEY (topic_goods_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1638 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '专题活动商品表'; -- -- Definition for table ns_promotion_tuangou -- DROP TABLE IF EXISTS ns_promotion_tuangou; CREATE TABLE ns_promotion_tuangou ( tuangou_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '团购主表id', goods_id INT(11) NOT NULL DEFAULT 0 COMMENT '商品id', tuangou_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '团购价格', tuangou_num INT(11) NOT NULL DEFAULT 0 COMMENT '团购人数', tuangou_time INT(11) NOT NULL DEFAULT 0 COMMENT '团购有效期', tuangou_type INT(11) NOT NULL DEFAULT 0 COMMENT '团购类型', tuangou_content_json VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '团购内容json', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间', is_open INT(11) NOT NULL DEFAULT 0 COMMENT '是否启用', remark VARCHAR(255) NOT NULL DEFAULT '' COMMENT '备注', modify_time INT(11) DEFAULT 0 COMMENT '修改时间', is_show INT(11) NOT NULL DEFAULT 0 COMMENT '是否首页显示', sku_json TEXT NOT NULL COMMENT '团购sku数据', PRIMARY KEY (tuangou_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 1489 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '团购主表'; -- -- Definition for table ns_recharge -- DROP TABLE IF EXISTS ns_recharge; CREATE TABLE ns_recharge ( id INT(11) NOT NULL AUTO_INCREMENT, activity_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '活动名称', start_time INT(11) NOT NULL DEFAULT 0 COMMENT '开始时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '结束时间', activity_type INT(1) NOT NULL DEFAULT 1 COMMENT '活动类型 1:单次充值满xx元 2:单次充值每满xx元', scene VARCHAR(255) NOT NULL DEFAULT '' COMMENT '适用场景 business 商家充值 member会员充值', data TEXT NOT NULL COMMENT '活动数据', status INT(1) NOT NULL DEFAULT 0 COMMENT '活动状态 0未开始 1已开始 -1已结束', PRIMARY KEY (id) ) ENGINE = MYISAM AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 312 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '充值活动表'; -- -- Definition for table ns_reward_rule -- DROP TABLE IF EXISTS ns_reward_rule; CREATE TABLE ns_reward_rule ( shop_id INT(10) UNSIGNED NOT NULL, sign_point INT(11) NOT NULL DEFAULT 0 COMMENT '签到送积分', share_point INT(11) NOT NULL DEFAULT 0 COMMENT '分享送积分', reg_member_self_point INT(11) NOT NULL DEFAULT 0 COMMENT '注册会员 自己获得的积分', reg_member_one_point INT(11) NOT NULL DEFAULT 0 COMMENT '注册会员 上级获得的积分', reg_member_two_point INT(11) NOT NULL DEFAULT 0 COMMENT '注册会员 上上级获得的积分', reg_member_three_point INT(11) NOT NULL DEFAULT 0 COMMENT '注册会员 上上上级获得的积分', reg_promoter_self_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为推广员 自己获得的积分', reg_promoter_one_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为推广员 上级获得的积分', reg_promoter_two_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为推广员 上上级获得的积分', reg_promoter_three_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为推广员 上上上级获得的积分', reg_partner_self_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为股东 自己获得的积分', reg_partner_one_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为股东 上级获得的积分', reg_partner_two_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为股东 上上级获得的积分', reg_partner_three_point INT(11) NOT NULL DEFAULT 0 COMMENT '成为股东 上上上级获得的积分', into_store_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '进店领用优惠券 存入优惠券id(coupon_id)', share_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '分享领用优惠券 存入优惠券id(coupon_id)', click_point INT(11) NOT NULL DEFAULT 0 COMMENT '点赞送积分', comment_point INT(11) NOT NULL DEFAULT 0 COMMENT '评论送积分', reg_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '注册送优惠券id', click_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '点赞送优惠券id', comment_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '评论送优惠券id', sign_coupon INT(11) NOT NULL DEFAULT 0 COMMENT '签到送优惠券id', PRIMARY KEY (shop_id) ) ENGINE = INNODB AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '奖励规则表'; -- -- Definition for table ns_tuangou_group -- DROP TABLE IF EXISTS ns_tuangou_group; CREATE TABLE ns_tuangou_group ( group_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, group_uid INT(11) NOT NULL DEFAULT 0 COMMENT '发起人id', group_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '发起人名', user_tel VARCHAR(255) NOT NULL DEFAULT '' COMMENT '团长联系方式', goods_id INT(11) NOT NULL DEFAULT 0 COMMENT '团购商品', goods_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '拼团商品名称', tuangou_money DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '团购商品价格', tuangou_type INT(11) NOT NULL DEFAULT 1 COMMENT '团购类型', tuangou_type_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '类型名称', price DECIMAL(10, 2) NOT NULL DEFAULT 0.00 COMMENT '团购基本价格', tuangou_num INT(11) NOT NULL DEFAULT 0 COMMENT '团购人数', real_num INT(11) NOT NULL DEFAULT 0 COMMENT '已参团人数', create_time INT(11) NOT NULL DEFAULT 0 COMMENT '创建时间', end_time INT(11) NOT NULL DEFAULT 0 COMMENT '结束时间', status INT(11) NOT NULL DEFAULT 0 COMMENT '1进行中,2已完成,-1拼团失败', is_recommend INT(11) NOT NULL DEFAULT 0 COMMENT '是否首页推荐', group_user_head_img VARCHAR(255) NOT NULL DEFAULT '' COMMENT '头像', PRIMARY KEY (group_id) ) ENGINE = INNODB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 390 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '拼团组合'; -- -- Definition for table ns_tuangou_type -- DROP TABLE IF EXISTS ns_tuangou_type; CREATE TABLE ns_tuangou_type ( type_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, type_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '团购类型名称', type_is_open INT(11) NOT NULL DEFAULT 0, type_content_json VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '类型json信息', PRIMARY KEY (type_id) ) ENGINE = INNODB AUTO_INCREMENT = 2 AVG_ROW_LENGTH = 5461 CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = '团购类型表'; ```