2021-10-20.sql 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. alter table box_setting
  2. add column `retail_1` decimal(12,2) DEFAULT '0.000' COMMENT '分销一级充值占比(%)',
  3. add column `retail_2` decimal(12,2) DEFAULT '0.000' COMMENT '分销二级充值占比(%)',
  4. add column `retail_3` decimal(12,2) DEFAULT '0.000' COMMENT '分销三级充值占比(%)';
  5. alter table box_setting
  6. add column `kou` int(11) DEFAULT '0' COMMENT '扣量';
  7. alter table box_user
  8. add column `retail_1` decimal(12,2) DEFAULT '0.000' COMMENT '分销一级充值占比(%)',
  9. add column `retail_2` decimal(12,2) DEFAULT '0.000' COMMENT '分销二级充值占比(%)',
  10. add column `retail_3` decimal(12,2) DEFAULT '0.000' COMMENT '分销三级充值占比(%)';
  11. CREATE TABLE `box_retail_invitation` (
  12. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  13. `user_id` int(10) unsigned DEFAULT NULL COMMENT '用户ID',
  14. `pid` int(10) unsigned DEFAULT NULL COMMENT '邀请人ID',
  15. `level` int(2) unsigned DEFAULT NULL COMMENT '1/2/3级',
  16. `create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
  17. PRIMARY KEY (`id`),
  18. KEY(`pid`),
  19. KEY(`user_id`)
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='分销关系表';
  21. CREATE TABLE `box_retail_detail` (
  22. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  23. `user_id` int(11) unsigned NOT NULL COMMENT '给谁分佣',
  24. `source_user_id` int(11) unsigned NOT NULL COMMENT '分佣来自于谁',
  25. `level` int(10) unsigned NOT NULL COMMENT '几级',
  26. `coin` decimal(12,2) DEFAULT '0' COMMENT '分佣金额',
  27. `create_time` int(10) unsigned DEFAULT NULL COMMENT '创建时间',
  28. PRIMARY KEY (`id`)
  29. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='分佣明细表';
  30. alter table box_coin_record change type
  31. type enum('pay_box','recharge','from_balance','refund','pay_delivery','retail')
  32. COLLATE utf8mb4_unicode_ci NOT NULL
  33. COMMENT '变更类型:pay_box=支付盲盒,recharge=充值,from_balance=余额转入,refund=库存不足,支付返回,pay_delivery=支付运费,retail=分销佣金';
  34. alter table box_user add column `retail_balance` decimal(12,2) default 0 comment '佣金余额';