From 03335a89bddb4a65720804048204315b5dd1be9b Mon Sep 17 00:00:00 2001 From: ljl Date: Thu, 3 Aug 2023 19:37:25 +0800 Subject: [PATCH] yh --- payment.sql | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/payment.sql b/payment.sql index 722ed68..d10092d 100644 --- a/payment.sql +++ b/payment.sql @@ -20,7 +20,7 @@ CREATE TABLE `users` ( KEY `idx_appid` (`app_id`) USING BTREE, KEY `idx_memberid` (`member_id`) USING BTREE, KEY `idx_createdat` (`created_at`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; CREATE TABLE `bank_cards` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', @@ -47,4 +47,93 @@ CREATE TABLE `bank_cards` ( KEY `idx_appid` (`app_id`) USING BTREE, KEY `idx_memberid` (`member_id`) USING BTREE, KEY `idx_createdat` (`created_at`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; + +CREATE TABLE `orders` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `app_id` varchar(16) NOT NULL COMMENT '应用ID', + `member_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `order_no` varchar(32) NOT NULL, + `out_order_no` varchar(32) NOT NULL, + `amount` int(11) NOT NULL DEFAULT 0, + `pay_type` varchar(10) NOT NULL, + `agreement_no` varchar(32) NOT NULL DEFAULT '', + `expired_at` datetime DEFAULT NULL, + `notify_url` varchar(255) NOT NULL DEFAULT '', + `return_url` varchar(255) NOT NULL DEFAULT '', + `status` varchar(16) NOT NULL DEFAULT '', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_appid` (`app_id`) USING BTREE, + KEY `idx_memberid` (`member_id`) USING BTREE, + KEY `idx_createdat` (`created_at`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; + +CREATE TABLE `order_split_infos` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `app_id` varchar(16) NOT NULL COMMENT '应用ID', + `member_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `split_member_id` varchar(32) NOT NULL, + `split_user_id` varchar(32) NOT NULL, + `order_no` varchar(32) NOT NULL, + `out_order_no` varchar(32) NOT NULL, + `sub_order_no` varchar(32) NOT NULL, + `sub_out_order_no` varchar(32) NOT NULL, + `split_amount` int(11) NOT NULL DEFAULT 0, + `contract_no` varchar(32) NOT NULL, + `seller_flag` tinyint(1) NOT null DEFAULT 0, + `status` varchar(16) NOT NULL DEFAULT '', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_appid` (`app_id`) USING BTREE, + KEY `idx_memberid` (`member_id`) USING BTREE, + KEY `idx_createdat` (`created_at`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; + +CREATE TABLE `refunds` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `app_id` varchar(16) NOT NULL COMMENT '应用ID', + `member_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `order_no` varchar(32) NOT NULL, + `out_order_no` varchar(32) NOT NULL, + `refund_order_no` varchar(32) NOT NULL, + `refund_out_order_no` varchar(32) NOT NULL, + `refund_amount` int(11) NOT NULL DEFAULT 0, + `refund_reason` varchar(255) NOT NULL DEFAULT '', + `refund_type` varchar(16) NOT NULL DEFAULT '', + `remark` varchar(255) NOT NULL DEFAULT '', + `notify_url` varchar(255) NOT NULL DEFAULT '', + `status` varchar(16) NOT NULL DEFAULT '', + `finished_at` datetime DEFAULT NULL, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_appid` (`app_id`) USING BTREE, + KEY `idx_memberid` (`member_id`) USING BTREE, + KEY `idx_createdat` (`created_at`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; + +CREATE TABLE `refund_split_infos` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `app_id` varchar(16) NOT NULL COMMENT '应用ID', + `member_id` varchar(32) NOT NULL, + `user_id` varchar(32) NOT NULL, + `split_member_id` varchar(32) NOT NULL, + `split_user_id` varchar(32) NOT NULL, + `order_no` varchar(32) NOT NULL, + `out_order_no` varchar(32) NOT NULL, + `sub_order_no` varchar(32) NOT NULL, + `sub_out_order_no` varchar(32) NOT NULL, + `refund_amount` int(11) NOT NULL DEFAULT 0, + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_appid` (`app_id`) USING BTREE, + KEY `idx_memberid` (`member_id`) USING BTREE, + KEY `idx_createdat` (`created_at`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC; \ No newline at end of file