| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- INSERT INTO `qimall_link_category`(`name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES ('store', 'O2O门店', 19, 1, '', 1, 1652410559, 1653104876);
- INSERT INTO `qimall_link_category`(`name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES ('store_cate', 'O2O门店分类', 19, 1, '', 1, 1653104617, 1653105081);
- INSERT INTO `qimall_link_category`(`name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES ('store_goods', 'O2O门店商品', 19, 1, '', 1, 1655275847, 1655275867);
- ALTER TABLE qimall_addons_store_commission add `settle_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1,2,3平台承担,4门店承担';
- CREATE TABLE `qimall_addons_store_video` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL COMMENT '商城id',
- `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
- `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
- `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
- `content` varchar(255) NOT NULL DEFAULT '' COMMENT '内容',
- `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店商品id',
- `reward_amount` DECIMAL(10,2) NOT NULL DEFAULT '0.00' COMMENT '用户观看后奖励金额',
- `viewing_times` int(10) NOT NULL DEFAULT '0' COMMENT '观看次数',
- `video_url` varchar(255) NOT NULL DEFAULT '' COMMENT '视频路径',
- `first_frame` varchar(255) NOT NULL DEFAULT '' COMMENT '首帧',
- `video_wide` int(11) NOT NULL DEFAULT '0' COMMENT '视频宽度',
- `video_long` int(11) NOT NULL DEFAULT '0' COMMENT '视频长度',
- `duration_str` varchar(20) NOT NULL DEFAULT '' COMMENT '视频时长(时分秒字符串形式),upload_type = video 时才有意义',
- `duration_seconds` float(6,2) NOT NULL DEFAULT '0.00' COMMENT '视频时长(秒为单位浮点数形式),upload_type = video 时才有意义',
- `is_on_sale` smallint(1) NOT NULL DEFAULT '0' COMMENT '上架状态【1是 0否】',
- `check_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '审核备注',
- `check_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '审核状态:0:未审核 1:审核通过 2:审核不通过',
- `check_time` int(11) NOT NULL DEFAULT '0' COMMENT '审核时间',
- `look_people_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '观看人数',
- `look_complete_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '完整观看人数',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频列表';
- CREATE TABLE `qimall_addons_store_video_order` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id',
- `video_id` int(11) NOT NULL DEFAULT '0' COMMENT '视频id',
- `order_no` varchar(100) NOT NULL DEFAULT '' COMMENT '订单编号',
- `pay_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付状态:0:否;1:是',
- `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '付款时间',
- `pay_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额',
- `payment_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付类型',
- `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[0禁用 1启用 -1删除]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_order_no` (`order_no`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='门店视频订单';
- CREATE TABLE `qimall_addons_store_order_credit` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店订单id',
- `type`tinyint(1) NOT NULL DEFAULT '1' COMMENT '类型[1:门店商品订单;2:收银台订单]',
- `is_repayment` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否还款:0:否;1:是',
- `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '付款时间',
- `down_payments` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '首付金额',
- `credit_money` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '赊账金额',
- `order_no` varchar(255) NOT NULL DEFAULT '' COMMENT '还款生成的支付订单编号',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[0禁用 1启用 -1删除]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- `extra` text COMMENT '',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='门店赊账订单';
- CREATE TABLE `qimall_addons_store_coupon` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL,
- `store_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
- `name` varchar(150) NOT NULL DEFAULT '' COMMENT '优惠券名称',
- `type` tinyint(1) NOT NULL DEFAULT '2' COMMENT '优惠券类型,1:折扣,2:满减',
- `discount` decimal(3,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '折扣率',
- `discount_limit` decimal(10,2) unsigned DEFAULT NULL COMMENT '折扣优惠金额上限',
- `min_price` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费金额',
- `sub_price` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠金额',
- `total_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券总数量',
- `sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序按升序排列',
- `expire_type` tinyint(1) NOT NULL DEFAULT '2' COMMENT '到期类型:1=领取后n天过期,2=指定有效期,3=领取后n天生效,生效后m天过期',
- `expire_day` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '有效天数,expire_type=1和3时',
- `effect_days` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '领取到生效之间间隔的天数(领取后n天生效)',
- `begin_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '有效期开始时间',
- `end_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '有效期结束时间',
- `appoint_type` tinyint(4) NOT NULL DEFAULT '3' COMMENT '1 指定分类 2 指定商品 3全部',
- `rule` text COMMENT '使用说明',
- `is_remind` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启提醒',
- `remind_days` tinyint(4) NOT NULL DEFAULT '3' COMMENT '提前提醒天数(到期前多少天提醒),is_remind=1 时有效',
- `is_receive_limit` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否限制领取',
- `receive_count` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '每人可以领取的数量,is_receive_limit=1时有意义',
- `is_member` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否指定会员等级',
- `is_original_use` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否原价购买使用(如果是,则只有原价购买商品时可以使用该优惠券)',
- `is_public_receive` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否公开领取,公开领取的优惠券会展示在商品详情页',
- `is_giving` tinyint(1) NOT NULL DEFAULT '0' COMMENT '启用优惠券转送功能:0-否;1-是;',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `coupon_status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '优惠券状态,1:未开始,2:领取中,3:已过期,4:已失效(后台操作失效)',
- `is_giving_reward` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启转赠奖励,开启后转赠优惠券自己可以获得额外奖励;is_giving=1 时有效',
- `is_consume_reward` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启使用奖励,开启后使用该优惠券可以获得额外奖励;is_giving=1 时有效',
- `is_open_screen` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开屏显示',
- `open_screen_frequency` varchar(255) NOT NULL DEFAULT '' COMMENT '开屏频率',
- `qrcode_url` varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券分享二维码保存路径,二维码包含内容:页面路径+优惠券id',
- `poster_url` varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券分享海报图片保存路径',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- `video_url` varchar(255) NOT NULL DEFAULT '' COMMENT '视频路径',
- `first_frame` varchar(255) NOT NULL DEFAULT '' COMMENT '首帧',
- `watch_times` int(11) NOT NULL DEFAULT '0' COMMENT '观看多少秒领取成功',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_id` (`mall_id`) USING BTREE,
- KEY `idx_expire_time` (`begin_at`,`end_at`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='优惠券';
- CREATE TABLE `qimall_addons_store_coupon_cat_relate` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `coupon_id` int(11) NOT NULL COMMENT '优惠券id',
- `cate_id` int(11) NOT NULL COMMENT '分类id',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分类下相关优惠券';
- CREATE TABLE `qimall_addons_store_coupon_give_item_setting` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL COMMENT '商城ID',
- `store_id` int(11) NOT NULL COMMENT '门店',
- `is_enable` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否独立设置:0:否;1是',
- `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '项目id',
- `item_type` varchar(255) NOT NULL DEFAULT '0' COMMENT '项目类型:商品goods',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id` (`mall_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='优惠券项目赠送设置';
- CREATE TABLE `qimall_addons_store_coupon_give_item_setting_detail` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL COMMENT '商城ID',
- `store_id` int(11) NOT NULL COMMENT '商城ID',
- `coupon_give_item_setting_id` int(11) NOT NULL DEFAULT '0' COMMENT '设置id',
- `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券id',
- `from_type` tinyint(1) NOT NULL COMMENT '类型:1:平台优惠券;2:门店优惠券',
- `num` int(11) NOT NULL DEFAULT '0' COMMENT '赠送数量',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id` (`mall_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='优惠券项目赠送设置详情';
- CREATE TABLE `qimall_addons_store_coupon_good_statistics` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL,
- `coupon_id` int(10) unsigned NOT NULL,
- `good_id` int(10) unsigned NOT NULL,
- `booking_number` int(11) NOT NULL DEFAULT '0' COMMENT '该商品使用该优惠券下单的总数量',
- `payed_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用该优惠券已支付的该商品数量',
- `booking_user_number` int(11) NOT NULL DEFAULT '0' COMMENT '该商品使用该优惠券下单的总人数',
- `buyed_user_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用该优惠券已购买该商品人数',
- `status` tinyint(1) 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',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_coupon_id` (`mall_id`,`coupon_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='使用优惠券购买的商品的相关数据统计';
- CREATE TABLE `qimall_addons_store_coupon_goods_relate` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `coupon_id` int(11) NOT NULL COMMENT '优惠券id',
- `goods_id` int(11) NOT NULL COMMENT '商品id',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品优惠券表';
- CREATE TABLE `qimall_addons_store_coupon_member_relate` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL,
- `coupon_id` int(11) NOT NULL COMMENT '优惠券id',
- `store_id` int(11) NOT NULL COMMENT '门店',
- `member_level` int(11) NOT NULL COMMENT '会员等级',
- `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员等级下优惠券表';
- CREATE TABLE `qimall_addons_store_coupon_remind` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
- `coupon_id` int(10) unsigned NOT NULL DEFAULT '0',
- `store_id` int(10) unsigned NOT NULL DEFAULT '0',
- `user_id` int(10) unsigned NOT NULL DEFAULT '0',
- `expire_time` int(10) unsigned NOT NULL,
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `send_status` tinyint(4) NOT NULL DEFAULT '2' COMMENT '提醒状态,1:未发送提醒,2:已发送提醒,3:不需要发送提醒,已使用或者已转赠或者优惠券已过期或者优惠券已经失效',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_coupon_user_id` (`mall_id`,`coupon_id`,`user_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券过期提醒记录表';
- CREATE TABLE `qimall_addons_store_coupon_reward` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL,
- `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
- `coupon_id` int(10) unsigned NOT NULL COMMENT '优惠券id',
- `reward_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '奖励类型,1:转赠奖励,2:使用奖励',
- `balance` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励余额',
- `score` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励积分',
- `red_packet` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励红包',
- `reward_currency_type` varchar(50) NOT NULL DEFAULT '' COMMENT '奖励货币种类,记录货币 code',
- `number` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励货币数量',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mallcoupon_id` (`mall_id`,`coupon_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券奖励记录表';
- CREATE TABLE `qimall_addons_store_coupon_reward_log` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL,
- `user_id` int(10) unsigned NOT NULL,
- `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
- `coupon_id` int(10) unsigned NOT NULL COMMENT '优惠券id',
- `reward_number` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励数额',
- `reward_scenarios` tinyint(4) NOT NULL DEFAULT '0' COMMENT '奖励场景,1:转赠奖励,2:使用奖励',
- `reward_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '奖励类型,1:余额,2:红包,3:积分,4:系统虚拟货币',
- `reward_type_code` varchar(20) NOT NULL DEFAULT '' COMMENT '奖励类型代码,balance:余额,red_packet:红包,score:积分,如果是虚拟货币,则记录其 code',
- `source_table` varchar(255) NOT NULL DEFAULT '' COMMENT '数据来源表',
- `source_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '数据来源id',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_user_coupon_id` (`mall_id`,`user_id`,`coupon_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券奖励发放记录';
- CREATE TABLE `qimall_addons_store_coupon_share_log` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
- `store_id` int(10) unsigned NOT NULL DEFAULT '0',
- `coupon_id` int(10) unsigned NOT NULL DEFAULT '0',
- `user_coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '赠送者coupon_user_relate表的id',
- `get_user_coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '领取者coupon_user_relate表的id',
- `giving_user_id` int(10) unsigned NOT NULL COMMENT '转出会员id,值为 0 说明是平台赠送的优惠券',
- `receive_user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '受赠会员id,尚未被领取此字段值为0',
- `giving_status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '转赠状态,1:转赠中(已分享出去,未被领取),2:已被领取',
- `created_at` int(10) unsigned NOT NULL DEFAULT '0',
- `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_coupon_id` (`mall_id`,`coupon_id`) USING BTREE,
- KEY `idx_gr_user_id` (`giving_user_id`,`receive_user_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券分享记录表';
- CREATE TABLE `qimall_addons_store_coupon_statistics` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) unsigned NOT NULL,
- `store_id` int(10) NOT NULL DEFAULT '0' COMMENT '门店id',
- `coupon_id` int(10) unsigned NOT NULL,
- `received_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已领取数量',
- `used_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已使用数量',
- `giveing_times` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券被转赠的次数',
- `use_probability` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '优惠券使用率,等于领取数量比使用数量',
- `total_discount_amount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '累计优惠金额',
- `receive_user_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '领券会员总数量',
- `use_user_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用券会员总数量',
- `giving_user_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '转赠优惠券的会员总数量',
- `use_order_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用优惠券支付的订单总数量',
- `total_use_coupon_payed_amount` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '使用优惠券后实际支付的总金额',
- `total_payed_amount` decimal(12,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '使用优惠券支付的订单原价总金额',
- `status` tinyint(1) 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',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_mall_coupon_id` (`mall_id`,`coupon_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券相关数据统计记录表';
- CREATE TABLE `qimall_addons_store_coupon_use_log` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT 'mall_id',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT 'user_id',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT 'order_id',
- `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT 'coupon_id',
- `user_coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT 'user_coupon_id',
- `status` tinyint(1) 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,
- KEY `idx_user_coupon_id` (`user_coupon_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='优惠券使用记录表';
- CREATE TABLE `qimall_addons_store_coupon_user_relate` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL,
- `store_id` int(10) NOT NULL DEFAULT '0' COMMENT '门店id',
- `from_type` tinyint(1) NOT NULL COMMENT '类型:1:平台优惠券;2:门店优惠券',
- `user_id` int(11) NOT NULL COMMENT '用户',
- `coupon_id` int(11) NOT NULL COMMENT '优惠卷',
- `coupon_status` tinyint(4) NOT NULL DEFAULT '2' COMMENT '优惠券状态,2:领取中,3:已过期,4:已失效(后台操作失效、转赠被领取后、使用之后)',
- `start_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券开始生效时间',
- `end_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券过期时间',
- `is_use` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已使用:0=未使用,1=已使用',
- `is_giving` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已赠送:0-否;1-是;',
- `giving_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '转赠状态,0:未转赠,1:转赠中,2:已被领取(转赠完成)',
- `receive_type` varchar(255) NOT NULL DEFAULT '' COMMENT '获取方式,如"商品详情页领取"',
- `receive_platform` varchar(25) NOT NULL DEFAULT 'h5' COMMENT '领取来源,从哪个平台领取的,wechat:微信,mp-wx:微信小程序,h5,app,work-wx:企业微信',
- `is_force_failure` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否强制失效,后台操作用户已领取的优惠券失效',
- `is_send_reward` tinyint(4) NOT NULL DEFAULT '0' 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',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `idx_cpid` (`coupon_id`) USING BTREE,
- KEY `idx_user_id` (`user_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户优惠券表';
- ALTER TABLE qimall_addons_store add `is_open_credit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启赊账功能 0:否;1:是';
- ALTER TABLE qimall_addons_store_goods add `credit_rate` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '赊账比例';
- ALTER TABLE qimall_addons_store_cashier_extra add `credit_rate` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '赊账比例';
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (31, '赊账', '0', 0, 'store/client/credit/index', 'el-icon-box', 3, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (32, '赊账记录', '0', 31, 'store/client/credit/index', '', 3, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (33, '赊账设置', '0', 31, 'store/client/credit/setting-credit', '', 3, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_crontab_task`( `name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('自动更新门店优惠券状态', 'store/coupon/update-coupon-status', 2, '0 */1 * * * *', 0, 1, 1660125107, 1660125107);
- CREATE TABLE `qimall_addons_store_extra` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `give_setting` longtext COMMENT '赠送设置',
- `deduct_setting` longtext COMMENT '抵扣设置',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[1正常 -1删除]',
- `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='门店额外信息表';
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (26, '优惠券', '0', 8, 'store/client/coupon/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (27, '优惠券管理', '0', 26, 'store/client/coupon/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (28, '会员优惠券', '0', 26, 'store/client/coupon/user-coupon', '', 2, 0, 999, NULL, '', 1, 0, 0);
- INSERT INTO `qimall_addons_store_menu`(`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (30, '优惠设置', '0', 8, 'store/client/discount/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
- alter table qimall_addons_store add payment_settlement_type tinyint(1) not null default 0 comment '门店货款结算方式,是否开启上传凭证,0:否;1:是';
- INSERT INTO `qimall_diy_components`( `code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ( 'store', 'O2O门店', 'other', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Store', 1, 1652929474, 1652929474);
- CREATE TABLE `qimall_addons_store_mini_code` (
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `mall_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
- `store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
- `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1:推广码;2:收银台二维码',
- `code` varchar(255) NOT NULL DEFAULT '' COMMENT '分享码',
- `content` varchar(255) NOT NULL DEFAULT '' COMMENT '二维码参数',
- `applet_code` varchar(255) DEFAULT '' COMMENT '小程序二维码图片地址',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态【1启用 0禁用 -1删除】',
- `created_at` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
- `updated_at` int(10) NOT NULL DEFAULT '0' COMMENT '上次更新数据时间',
- PRIMARY KEY (`id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='门店小程序码生成表'
- ALTER TABLE `qimall_addons_store_commission`
- ADD COLUMN `store_send_commission` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '门店直接发放佣金,不包含平台设置的插件佣金' AFTER `settle_type`;
- ALTER TABLE qimall_addons_store_goods add is_recommend tinyint(1) not null default 0 COMMENT '店铺推荐:0:否;1:是';
- ALTER TABLE qimall_addons_store_goods add show_style tinyint(1) not null default 1 COMMENT '商品展示风格:1:;2:';
- ALTER TABLE qimall_addons_store_goods_attr add attr_detail text COMMENT '规格详情';
- ALTER TABLE qimall_addons_store add show_style tinyint(1) not null default 1 COMMENT '门店装修风格:1:;2:';
- ALTER TABLE qimall_addons_store add bannar_pic text COMMENT '门店轮播图';
- ALTER TABLE qimall_addons_store add introduce text COMMENT '门店介绍';
- ALTER TABLE `qimall_addons_store_goods` add package_data longtext NULL COMMENT '套餐json数据';
- ALTER TABLE qimall_addons_store_cate add is_collect_service_fee tinyint(1) not null default 0 comment '是否收取服务费:1是;0:否';
- ALTER TABLE qimall_addons_store_cate add collect_service_fee decimal(12,2) not null default 0 comment '服务费比例';
|