install.sql 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 
  2. BEGIN;
  3. CREATE TABLE `__PREFIX__recharge_order` (
  4. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  5. `orderid` varchar(100) DEFAULT NULL COMMENT '订单ID',
  6. `user_id` int(10) unsigned DEFAULT '0' COMMENT '会员ID',
  7. `amount` double(10,2) unsigned DEFAULT '0.00' COMMENT '订单金额',
  8. `payamount` double(10,2) unsigned DEFAULT '0.00' COMMENT '支付金额',
  9. `paytype` varchar(50) DEFAULT NULL COMMENT '支付类型',
  10. `paytime` int(10) DEFAULT NULL COMMENT '支付时间',
  11. `ip` varchar(50) DEFAULT NULL COMMENT 'IP地址',
  12. `useragent` varchar(255) DEFAULT NULL COMMENT 'UserAgent',
  13. `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  14. `createtime` int(10) DEFAULT NULL COMMENT '添加时间',
  15. `updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
  16. `status` enum('created','paid','expired') DEFAULT 'created' COMMENT '状态',
  17. PRIMARY KEY (`id`)
  18. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='充值表';
  19. COMMIT;
  20. BEGIN;
  21. ALTER TABLE `__PREFIX__user` ADD COLUMN `money` decimal(10, 2) UNSIGNED NULL DEFAULT 0 COMMENT '余额' AFTER `bio`;
  22. COMMIT;
  23. BEGIN;
  24. CREATE TABLE `__PREFIX__user_money_log` (
  25. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  26. `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  27. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
  28. `before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更前余额',
  29. `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更后余额',
  30. `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  31. `createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  32. PRIMARY KEY (`id`),
  33. KEY `user_id` (`user_id`)
  34. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='会员余额变动表';
  35. COMMIT;