20250721-积分加现金.sql 1.4 KB

1234567891011121314151617181920212223
  1. alter table fs_integral_goods
  2. add column cash decimal(10,2) default 0 comment '需支付金额' after `integral`;
  3. alter table fs_integral_order
  4. add column pay_money decimal(11,2) DEFAULT NULL COMMENT '支付金额' after `integral`,
  5. add column is_pay tinyint(1) DEFAULT NULL COMMENT '是否支付 0未支付 1已支付' after `pay_money`,
  6. add column `pay_time` datetime DEFAULT NULL COMMENT '支付时间' after `is_pay`,
  7. add column `pay_type` int DEFAULT NULL COMMENT '支付类型 1积分 2现金 3积分+现金' after `pay_time`;
  8. drop table if exists `fs_integral_cart`;
  9. create table `fs_integral_cart` (
  10. `id` bigint not null auto_increment comment '主键ID',
  11. `user_id` bigint not null comment '用户ID',
  12. `goods_id` bigint not null comment '积分商品ID',
  13. `integral` int default 0 comment '所需积分-单价',
  14. `cash` decimal(10,2) default 0 comment '所需金额-单价',
  15. `cart_num` int not null comment '数量',
  16. `create_time` datetime comment '添加时间',
  17. `update_time` datetime comment '修改时间',
  18. primary key (`id`) using btree,
  19. unique key uk_user_goods(`user_id`, `goods_id`),
  20. key idx_goods(`goods_id`)
  21. ) engine = Innodb comment '积分商品购物车';