finance-pay/sql/1.6.0.20230306/like.sql

107 lines
7.4 KiB
MySQL
Raw Permalink Normal View History

2023-11-15 12:02:33 +08:00
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `la_user` ADD COLUMN `is_new_user` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否是新注册用户: [1-是, 0-否]' AFTER `login_time`;
ALTER TABLE `la_user` ADD COLUMN `user_money` decimal(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '用户余额' AFTER `is_new_user`;
ALTER TABLE `la_user` ADD COLUMN `total_recharge_amount` decimal(10, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '累计充值' AFTER `user_money`;
CREATE TABLE `la_dev_pay_config` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL DEFAULT '' COMMENT '模版名称',
`pay_way` tinyint(1) NOT NULL COMMENT '支付方式:1-余额支付;2-微信支付;3-支付宝支付;',
`config` text NULL COMMENT '对应支付配置(json字符串)',
`icon` varchar(255) NULL DEFAULT NULL COMMENT '图标',
`sort` int(5) NULL DEFAULT NULL COMMENT '排序',
`remark` varchar(255) NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
);
CREATE TABLE `la_dev_pay_way` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`pay_config_id` int(11) NOT NULL COMMENT '支付配置ID',
`scene` tinyint(1) NOT NULL COMMENT '场景:1-微信小程序;2-微信公众号;3-H5;4-PC;5-APP;',
`is_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否默认支付:0-否;1-是;',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:0-关闭;1-开启;',
PRIMARY KEY (`id`) USING BTREE
);
CREATE TABLE `la_recharge_order` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sn` varchar(64) NOT NULL COMMENT '订单编号',
`user_id` int(11) NOT NULL COMMENT '用户id',
`pay_sn` varchar(255) NULL DEFAULT '' COMMENT '支付编号-冗余字段,针对微信同一主体不同客户端支付需用不同订单号预留。',
`pay_way` tinyint(2) NOT NULL DEFAULT 2 COMMENT '支付方式 2-微信支付 3-支付宝支付',
`pay_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付状态0-待支付1-已支付',
`pay_time` int(10) NULL DEFAULT NULL COMMENT '支付时间',
`order_amount` decimal(10, 2) NOT NULL COMMENT '充值金额',
`order_terminal` tinyint(1) NULL DEFAULT 1 COMMENT '终端',
`transaction_id` varchar(128) NULL DEFAULT NULL COMMENT '第三方平台交易流水号',
`refund_status` tinyint(1) NULL DEFAULT 0 COMMENT '退款状态 0-未退款 1-已退款',
`create_time` int(10) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` int(10) NULL DEFAULT NULL COMMENT '更新时间',
`delete_time` int(10) NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
);
CREATE TABLE `la_refund_log` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sn` varchar(32) NULL DEFAULT NULL COMMENT '编号',
`record_id` int(11) NOT NULL COMMENT '退款记录id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联用户',
`handle_id` int(11) NOT NULL DEFAULT 0 COMMENT '处理人id管理员id',
`order_amount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '订单总的应付款金额,冗余字段',
`refund_amount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '本次退款金额',
`refund_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款状态0退款中1退款成功2退款失败',
`refund_msg` text NULL COMMENT '退款信息',
`create_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(10) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
);
CREATE TABLE `la_refund_record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`sn` varchar(32) NOT NULL DEFAULT '' COMMENT '退款编号',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联用户',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '来源订单id',
`order_sn` varchar(32) NOT NULL COMMENT '来源单号',
`order_type` varchar(255) NULL DEFAULT 'order' COMMENT '订单来源 order-商品订单 recharge-充值订单',
`order_amount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '订单总的应付款金额,冗余字段',
`refund_amount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '本次退款金额',
`transaction_id` varchar(255) NULL DEFAULT NULL COMMENT '第三方平台交易流水号',
`refund_way` tinyint(1) NOT NULL DEFAULT 1 COMMENT '退款方式 1-线上退款 2-线下退款',
`refund_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '退款类型 1-后台退款',
`refund_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款状态0退款中1退款成功2退款失败',
`create_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int(10) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
);
CREATE TABLE `la_user_account_log` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`sn` varchar(32) NOT NULL DEFAULT '' COMMENT '流水号',
`user_id` int(11) NOT NULL COMMENT '用户id',
`change_object` tinyint(1) NOT NULL DEFAULT 0 COMMENT '变动对象',
`change_type` smallint(5) NOT NULL COMMENT '变动类型',
`action` tinyint(1) NOT NULL DEFAULT 0 COMMENT '动作 1-增加 2-减少',
`change_amount` decimal(10, 2) NOT NULL COMMENT '变动数量',
`left_amount` decimal(10, 2) NOT NULL DEFAULT 100.00 COMMENT '变动后数量',
`source_sn` varchar(255) NULL DEFAULT NULL COMMENT '关联单号',
`remark` varchar(255) NULL DEFAULT '' COMMENT '备注',
`extra` text NULL COMMENT '预留扩展字段',
`create_time` int(10) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` int(10) NULL DEFAULT NULL COMMENT '更新时间',
`delete_time` int(10) NULL DEFAULT NULL COMMENT '删除时间',
PRIMARY KEY (`id`) USING BTREE
);
INSERT INTO `la_dev_pay_config` VALUES (1, '余额支付', 1, '', '/resource/image/adminapi/default/balance_pay.png', 128, '余额支付备注'), (2, '微信支付', 2, '{\"interface_version\":\"v3\",\"merchant_type\":\"ordinary_merchant\",\"mch_id\":\"\",\"pay_sign_key\":\"\",\"apiclient_cert\":\"\",\"apiclient_key\":\"\"}', '/resource/image/adminapi/default/wechat_pay.png', 123, '微信支付备注');
INSERT INTO `la_dev_pay_way` VALUES (1, 1, 1, 0, 1), (2, 2, 1, 1, 1), (3, 1, 2, 0, 1), (4, 2, 2, 1, 1), (5, 1, 3, 0, 1), (6, 2, 3, 1, 1);
UPDATE `la_decorate_page` SET `type` = 2, `name` = '个人中心', `data` = '[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":2,\"title\":\"服务中心\",\"data\":[{\"image\":\"/resource/image/adminapi/default/user_collect.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"/resource/image/adminapi/default/user_setting.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"/resource/image/adminapi/default/user_kefu.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}},{\"image\":\"/resource/image/adminapi/default/wallet.png\",\"name\":\"我的钱包\",\"link\":{\"path\":\"/packages/pages/user_wallet/user_wallet\",\"name\":\"我的钱包\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"/resource/image/adminapi/default/ad01.jpg\",\"name\":\"\",\"link\":{}}]},\"styles\":{}}]', `create_time` = 1661757188, `update_time` = 1663320728 WHERE `id` = 2;
SET FOREIGN_KEY_CHECKS=1;