vr-shopxo-source/application/plugins/wallet/install.sql

75 lines
4.5 KiB
MySQL
Raw Normal View History

2019-04-30 08:27:01 +00:00
# 钱包
2019-06-12 16:56:02 +00:00
CREATE TABLE `{PREFIX}plugins_wallet` (
2019-04-30 08:27:01 +00:00
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
`status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态0正常, 1异常, 2已注销',
2019-06-10 09:37:06 +00:00
`normal_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '有效金额(包含赠送金额)',
`frozen_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '冻结金额',
`give_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '赠送金额(所有赠送金额总计)',
2019-04-30 08:27:01 +00:00
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
`upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `status` (`status`),
KEY `user_id` (`user_id`)
2019-06-12 16:56:02 +00:00
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='钱包 - 应用';
2019-04-30 08:27:01 +00:00
# 钱包日志
2019-06-12 16:56:02 +00:00
CREATE TABLE `{PREFIX}plugins_wallet_log` (
2019-04-30 08:27:01 +00:00
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
`wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
2019-05-06 10:39:23 +00:00
`business_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '业务类型0系统, 1充值, 2提现, 3消费',
2019-05-07 03:05:04 +00:00
`money_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '金额类型0正常, 1冻结, 2赠送',
2019-05-06 10:39:23 +00:00
`operation_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型( 0减少, 1增加',
2019-06-10 09:37:06 +00:00
`operation_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作金额',
`original_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原始金额',
`latest_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最新金额',
2019-04-30 08:27:01 +00:00
`msg` char(200) NOT NULL DEFAULT '' COMMENT '变更说明',
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`),
KEY `wallet_id` (`wallet_id`),
KEY `user_id` (`user_id`)
2019-06-12 16:56:02 +00:00
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='钱包日志 - 应用';
2019-05-08 10:19:23 +00:00
2019-06-10 09:37:06 +00:00
# 充值
2019-06-12 16:56:02 +00:00
CREATE TABLE `{PREFIX}plugins_wallet_recharge` (
2019-06-10 09:37:06 +00:00
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
`wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
`recharge_no` char(60) NOT NULL DEFAULT '' COMMENT '充值单号',
`status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态0未支付, 1已支付',
`money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '金额',
`pay_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
`payment_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式id',
`payment` char(60) NOT NULL DEFAULT '' COMMENT '支付方式标记',
`payment_name` char(60) NOT NULL DEFAULT '' COMMENT '支付方式名称',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`),
UNIQUE KEY `recharge_no` (`recharge_no`),
KEY `status` (`status`),
KEY `user_id` (`user_id`)
2019-06-12 16:56:02 +00:00
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='钱包充值 - 应用';
2019-06-10 09:37:06 +00:00
2019-05-08 10:19:23 +00:00
# 钱包提现
2019-06-12 16:56:02 +00:00
CREATE TABLE `{PREFIX}plugins_wallet_cash` (
2019-05-08 10:19:23 +00:00
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
`wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
`cash_no` char(60) NOT NULL DEFAULT '' COMMENT '提现单号',
`status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态0未打款, 1已打款, 2打款失败',
`money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现金额',
`pay_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '打款金额',
`bank_name` char(60) NOT NULL DEFAULT '' COMMENT '收款银行',
`bank_accounts` char(60) NOT NULL DEFAULT '' COMMENT '收款账号',
`bank_username` char(60) NOT NULL DEFAULT '' COMMENT '开户人姓名',
`msg` char(200) NOT NULL DEFAULT '' COMMENT '描述(用户可见)',
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '打款时间',
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
`upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `cash_no` (`cash_no`),
KEY `status` (`status`),
KEY `user_id` (`user_id`),
KEY `wallet_id` (`wallet_id`)
2019-06-12 16:56:02 +00:00
) ENGINE=InnoDB DEFAULT CHARSET={CHARSET} ROW_FORMAT=DYNAMIC COMMENT='钱包提现 - 应用';