完善sql

This commit is contained in:
2026-05-09 17:56:58 +08:00
parent ca1aff48a2
commit fdcc187384
2 changed files with 376 additions and 449 deletions

View File

@@ -1,85 +0,0 @@
-- 清理演示过程数据限时活动、限时订单、admin 前台订单/拼团/评价/收藏/通知数据
-- 适用于已导入 flash_sale_db.sql 的 MySQL 数据库。
SET @admin_user_id := (SELECT id
FROM users
WHERE username = 'admin'
LIMIT 1);
CREATE TEMPORARY TABLE IF NOT EXISTS cleanup_group_ids
(
id BIGINT PRIMARY KEY
) ENGINE = Memory;
CREATE TEMPORARY TABLE IF NOT EXISTS cleanup_order_ids
(
id BIGINT PRIMARY KEY
) ENGINE = Memory;
TRUNCATE TABLE cleanup_group_ids;
TRUNCATE TABLE cleanup_order_ids;
INSERT IGNORE INTO cleanup_group_ids (id)
SELECT id
FROM group_buying_group
WHERE leader_user_id = @admin_user_id;
INSERT IGNORE INTO cleanup_order_ids (id)
SELECT id
FROM orders
WHERE order_type = 2
OR flash_sale_id IS NOT NULL
OR user_id = @admin_user_id
OR group_buying_group_id IN (SELECT id FROM cleanup_group_ids);
DELETE n
FROM notifications n
WHERE n.user_id = @admin_user_id
OR n.link IN (SELECT CONCAT('/order/', id)
FROM cleanup_order_ids);
DELETE pr
FROM product_reviews pr
WHERE pr.user_id = @admin_user_id
OR pr.order_id IN (SELECT id FROM cleanup_order_ids);
DELETE r
FROM order_returns r
WHERE r.user_id = @admin_user_id
OR r.order_id IN (SELECT id FROM cleanup_order_ids);
DELETE oi
FROM order_items oi
WHERE oi.order_id IN (SELECT id FROM cleanup_order_ids);
DELETE gbm
FROM group_buying_member gbm
WHERE gbm.user_id = @admin_user_id
OR gbm.order_id IN (SELECT id FROM cleanup_order_ids)
OR gbm.group_id IN (SELECT id FROM cleanup_group_ids);
DELETE o
FROM orders o
WHERE o.id IN (SELECT id FROM cleanup_order_ids);
DELETE g
FROM group_buying_group g
WHERE g.id IN (SELECT id FROM cleanup_group_ids);
DELETE uf
FROM user_favorites uf
WHERE uf.user_id = @admin_user_id;
DELETE ua
FROM user_addresses ua
WHERE ua.user_id = @admin_user_id;
DELETE
FROM flash_sales;
UPDATE users
SET role = 'ADMIN'
WHERE username = 'admin';
DROP TEMPORARY TABLE IF EXISTS cleanup_order_ids;
DROP TEMPORARY TABLE IF EXISTS cleanup_group_ids;

View File

@@ -11,7 +11,7 @@
Target Server Version : 80036 (8.0.36) Target Server Version : 80036 (8.0.36)
File Encoding : 65001 File Encoding : 65001
Date: 25/03/2026 23:57:40 Date: 09/05/2026 17:56:28
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
@@ -23,10 +23,10 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `flash_sales`; DROP TABLE IF EXISTS `flash_sales`;
CREATE TABLE `flash_sales` CREATE TABLE `flash_sales`
( (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '限时活动ID', `id` bigint NOT NULL AUTO_INCREMENT COMMENT '秒杀活动ID',
`product_id` bigint NOT NULL COMMENT '商品ID', `product_id` bigint NOT NULL COMMENT '商品ID',
`flash_price` decimal(10, 2) NOT NULL COMMENT '活动价格', `flash_price` decimal(10, 2) NOT NULL COMMENT '秒杀价格',
`flash_stock` int NOT NULL COMMENT '活动库存', `flash_stock` int NOT NULL COMMENT '秒杀库存',
`start_time` timestamp NOT NULL COMMENT '开始时间', `start_time` timestamp NOT NULL COMMENT '开始时间',
`end_time` timestamp NOT NULL COMMENT '结束时间', `end_time` timestamp NOT NULL COMMENT '结束时间',
`status` tinyint DEFAULT '1' COMMENT '状态1-未开始2-进行中3-已结束', `status` tinyint DEFAULT '1' COMMENT '状态1-未开始2-进行中3-已结束',
@@ -40,9 +40,9 @@ CREATE TABLE `flash_sales`
KEY `idx_created_at` (`created_at`), KEY `idx_created_at` (`created_at`),
CONSTRAINT `flash_sales_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE CONSTRAINT `flash_sales_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 13 AUTO_INCREMENT = 64
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='限时活动表'; COLLATE = utf8mb4_unicode_ci COMMENT ='秒杀活动表';
-- ---------------------------- -- ----------------------------
-- Records of flash_sales -- Records of flash_sales
@@ -50,13 +50,123 @@ CREATE TABLE `flash_sales`
BEGIN; BEGIN;
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`, INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`) `created_at`, `updated_at`)
VALUES (10, 4, 0.01, 10, '2026-03-14 15:55:00', '2026-08-02 15:55:00', 2, '2026-03-14 15:50:34', '2026-03-14 09:55:25'); VALUES (1, 1, 3.19, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`, INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`) `created_at`, `updated_at`)
VALUES (11, 1, 0.01, 9, '2026-03-14 17:12:00', '2027-03-19 17:12:00', 2, '2026-03-14 17:07:14', '2026-03-14 09:47:30'); VALUES (2, 2, 4.64, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`, INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`) `created_at`, `updated_at`)
VALUES (12, 2, 0.01, 1, '2026-03-14 20:48:00', '2027-03-13 20:48:00', 1, '2026-03-14 20:43:59', '2026-03-14 12:43:59'); VALUES (3, 3, 3.60, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (4, 4, 4.16, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (5, 5, 5.52, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (6, 6, 3.92, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (7, 7, 4.48, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (8, 8, 3.84, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (9, 9, 10.32, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49', '2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (10, 10, 9.44, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (11, 11, 5.52, 80, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (12, 12, 10.88, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (13, 13, 15.92, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (14, 14, 19.92, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (15, 15, 23.04, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (16, 16, 26.32, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (17, 17, 15.12, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (18, 18, 17.44, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (19, 19, 11.12, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (20, 20, 18.24, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (21, 21, 13.44, 30, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (22, 22, 31.92, 30, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (23, 23, 15.04, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (24, 24, 10.32, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (25, 25, 39.92, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (26, 26, 62.40, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (27, 27, 20.72, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (28, 28, 47.92, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (29, 29, 10.24, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (30, 30, 13.52, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (31, 31, 5.52, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
INSERT INTO `flash_sales` (`id`, `product_id`, `flash_price`, `flash_stock`, `start_time`, `end_time`, `status`,
`created_at`, `updated_at`)
VALUES (32, 32, 7.92, 50, '2026-05-09 08:48:49', '2026-05-23 09:48:49', 2, '2026-05-09 09:48:49',
'2026-05-09 09:48:49');
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -82,7 +192,7 @@ CREATE TABLE `group_buying`
KEY `FK59r61d7iyp2vxxkoyjudk343o` (`product_id`), KEY `FK59r61d7iyp2vxxkoyjudk343o` (`product_id`),
CONSTRAINT `FK59r61d7iyp2vxxkoyjudk343o` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) CONSTRAINT `FK59r61d7iyp2vxxkoyjudk343o` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 4 AUTO_INCREMENT = 64
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -93,18 +203,163 @@ BEGIN;
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`, INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`, `product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`) `updated_at`)
VALUES (1, '2026-03-13 23:32:29.162000', 1440, '2026-07-05 00:00:00.000000', 0.01, 1, 1, 98, 2, VALUES (1, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 3.59, 2, 1, 100, 2,
'2026-03-13 23:32:21.000000', 2, 100, '2026-03-13 23:32:32.081000'); '2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`, INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`, `product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`) `updated_at`)
VALUES (2, '2026-03-14 15:49:21.162000', 1440, '2026-03-29 15:54:00.000000', 0.01, 1, 5, 95, 2, VALUES (2, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 5.22, 2, 2, 100, 2,
'2026-03-14 15:54:00.000000', 2, 100, '2026-03-14 15:49:25.451000'); '2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`, INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`, `product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`) `updated_at`)
VALUES (3, '2026-03-16 23:57:24.818000', 1440, '2026-03-18 00:02:00.000000', 0.01, 3, 11, 96, 2, VALUES (3, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 4.05, 2, 3, 100, 2,
'2026-03-16 00:02:00.000000', 2, 100, '2026-03-17 00:17:44.859000'); '2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (4, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 4.68, 2, 4, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (5, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 6.21, 2, 5, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (6, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 4.41, 2, 6, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (7, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 5.04, 2, 7, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (8, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 4.32, 2, 8, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (9, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 11.61, 2, 9, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (10, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 10.62, 2, 10, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (11, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 6.21, 2, 11, 100, 2,
'2026-05-09 08:48:49.000000', 2, 100, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (12, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 12.24, 2, 12, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (13, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 17.91, 2, 13, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (14, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 22.41, 2, 14, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (15, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 25.92, 2, 15, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (16, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 29.61, 2, 16, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (17, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 17.01, 2, 17, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (18, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 19.62, 2, 18, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (19, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 12.51, 2, 19, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (20, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 20.52, 2, 20, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (21, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 15.12, 2, 21, 30, 3,
'2026-05-09 08:48:49.000000', 2, 30, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (22, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 35.91, 2, 22, 30, 3,
'2026-05-09 08:48:49.000000', 2, 30, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (23, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 16.92, 2, 23, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (24, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 11.61, 2, 24, 60, 3,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (25, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 44.91, 2, 25, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (26, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 70.20, 2, 26, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (27, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 23.31, 2, 27, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (28, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 53.91, 2, 28, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (29, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 11.52, 2, 29, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (30, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 15.21, 2, 30, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (31, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 6.21, 2, 31, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
INSERT INTO `group_buying` (`id`, `created_at`, `duration_minutes`, `end_time`, `group_price`, `max_per_user`,
`product_id`, `remaining_stock`, `required_members`, `start_time`, `status`, `total_stock`,
`updated_at`)
VALUES (32, '2026-05-09 09:48:49.000000', 1440, '2026-05-23 09:48:49.000000', 8.91, 2, 32, 60, 2,
'2026-05-09 08:48:49.000000', 2, 60, '2026-05-09 09:48:49.000000');
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -130,7 +385,6 @@ CREATE TABLE `group_buying_group`
CONSTRAINT `FKmc231ojxg44fsobry8h71p7ts` FOREIGN KEY (`leader_user_id`) REFERENCES `users` (`id`), CONSTRAINT `FKmc231ojxg44fsobry8h71p7ts` FOREIGN KEY (`leader_user_id`) REFERENCES `users` (`id`),
CONSTRAINT `FKqa4p2gmyfgv73i1278fncxyjd` FOREIGN KEY (`group_buying_id`) REFERENCES `group_buying` (`id`) CONSTRAINT `FKqa4p2gmyfgv73i1278fncxyjd` FOREIGN KEY (`group_buying_id`) REFERENCES `group_buying` (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 8
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -138,32 +392,6 @@ CREATE TABLE `group_buying_group`
-- Records of group_buying_group -- Records of group_buying_group
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (1, '2026-03-16 21:06:50.390000', '2026-03-14 15:49:34.380000', 1, '2026-03-15 15:49:34.379000', 1,
'GB1773474574379662', 3, 2, 3);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (2, '2026-03-16 16:01:20.000000', '2026-03-16 21:09:52.417000', 2, '2026-03-17 21:09:52.413000', 1,
'GB1773666592413340', 3, 2, 2);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (3, '2026-03-16 16:01:20.000000', '2026-03-16 23:36:48.080000', 2, '2026-03-17 23:36:48.076000', 2,
'GB1773675408076559', 3, 2, 2);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (4, '2026-03-16 16:01:20.000000', '2026-03-16 23:44:34.651000', 2, '2026-03-17 23:44:34.647000', 2,
'GB1773675874647308', 3, 2, 2);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (5, NULL, '2026-03-16 23:47:02.225000', 1, '2026-03-17 23:47:02.224000', 2, 'GB1773676022224046', 15, 2, 1);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (6, NULL, '2026-03-17 00:06:39.985000', 2, '2026-03-18 00:06:39.983000', 3, 'GB1773677199982359', 3, 2, 1);
INSERT INTO `group_buying_group` (`id`, `completed_at`, `created_at`, `current_members`, `expire_time`,
`group_buying_id`, `group_no`, `leader_user_id`, `required_members`, `status`)
VALUES (7, '2026-03-17 00:18:19.615000', '2026-03-17 00:17:54.946000', 2, '2026-03-18 00:17:54.941000', 3,
'GB1773677874941488', 3, 2, 2);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -184,7 +412,6 @@ CREATE TABLE `group_buying_member`
CONSTRAINT `FK2k1d07r2qich4sqquxisdkf7e` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT `FK2k1d07r2qich4sqquxisdkf7e` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
CONSTRAINT `FKplwuuxax228wqw6nr6pnmmllq` FOREIGN KEY (`group_id`) REFERENCES `group_buying_group` (`id`) CONSTRAINT `FKplwuuxax228wqw6nr6pnmmllq` FOREIGN KEY (`group_id`) REFERENCES `group_buying_group` (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 13
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -192,30 +419,6 @@ CREATE TABLE `group_buying_member`
-- Records of group_buying_member -- Records of group_buying_member
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (1, 1, '2026-03-14 15:49:34.432000', 21, 3, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (2, 2, '2026-03-16 21:09:52.464000', 23, 2, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (3, 2, '2026-03-16 23:09:11.629000', 25, 2, 15);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (4, 3, '2026-03-16 23:36:48.130000', 26, 2, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (5, 3, '2026-03-16 23:37:04.179000', 27, 2, 15);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (6, 4, '2026-03-16 23:44:34.711000', 28, 2, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (7, 4, '2026-03-16 23:45:05.179000', 29, 2, 15);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (8, 5, '2026-03-16 23:47:02.250000', 30, 1, 15);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (9, 6, '2026-03-17 00:06:40.074000', 31, 1, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (10, 6, '2026-03-17 00:06:47.015000', 32, 1, 15);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (11, 7, '2026-03-17 00:17:55.040000', 33, 2, 3);
INSERT INTO `group_buying_member` (`id`, `group_id`, `joined_at`, `order_id`, `status`, `user_id`)
VALUES (12, 7, '2026-03-17 00:18:19.601000', 34, 2, 15);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -244,39 +447,6 @@ CREATE TABLE `notifications`
-- Records of notifications -- Records of notifications
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (4, '2026-03-16 23:07:03.974000', '/order/24', '您的订单 #24 已创建,请尽快完成支付', b'0', '订单创建成功',
'order', 3);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (5, '2026-03-16 23:07:12.309000', '/order/24', '您的订单 #24 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 3);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (6, '2026-03-16 23:09:32.499000', '/order/25', '您的订单 #25 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 15);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (7, '2026-03-16 23:10:35.244000', '/order/23', '您的订单 #23 退货申请已提交,请等待审核', b'0', '退货申请已提交',
'return', 3);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (8, '2026-03-16 23:11:26.084000', '/order/23', '您的订单 #23 退货申请已通过,请尽快寄回商品', b'0',
'退货申请已通过', 'return', 3);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (9, '2026-03-16 23:37:56.413000', '/order/26', '您的订单 #26 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 3);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (10, '2026-03-16 23:38:20.405000', '/order/27', '您的订单 #27 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 15);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (11, '2026-03-16 23:46:54.529000', '/order/29', '您的订单 #29 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 15);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (12, '2026-03-16 23:47:12.529000', '/order/30', '您的订单 #30 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 15);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (13, '2026-03-17 00:09:01.296000', '/order/32', '您的订单 #32 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 15);
INSERT INTO `notifications` (`id`, `created_at`, `link`, `message`, `is_read`, `title`, `type`, `user_id`)
VALUES (14, '2026-03-17 00:09:21.874000', '/order/31', '您的订单 #31 已支付成功,等待商家发货', b'0', '订单支付成功',
'order', 3);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -296,7 +466,6 @@ CREATE TABLE `order_items`
`subtotal` decimal(10, 2) NOT NULL, `subtotal` decimal(10, 2) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 14
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -304,58 +473,6 @@ CREATE TABLE `order_items`
-- Records of order_items -- Records of order_items
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (1, '2026-03-16 23:07:03.951000', 24, 168.00, 14,
'/uploads/products/2026/03/14/2e380b9213824856b7d00e0d2b54b436.png', '五常大米 10kg', 2, 336.00);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (2, '2026-03-16 23:36:48.126000', 26, 0.01, 5,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'Apple Watch Series 9', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (3, '2026-03-16 23:37:04.171000', 27, 0.01, 5,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'Apple Watch Series 9', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (4, '2026-03-16 23:44:34.708000', 28, 0.01, 5,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'Apple Watch Series 9', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (5, '2026-03-16 23:45:05.177000', 29, 0.01, 5,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'Apple Watch Series 9', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (6, '2026-03-16 23:47:02.241000', 30, 0.01, 5,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'Apple Watch Series 9', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (7, '2026-03-14 15:49:34.000000', 21, 0.01, 1,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'iPhone 15 Pro Max', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (8, '2026-03-16 21:09:52.000000', 23, 0.01, 1,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'iPhone 15 Pro Max', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (9, '2026-03-16 23:09:12.000000', 25, 0.01, 1,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 'iPhone 15 Pro Max', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (10, '2026-03-17 00:06:40.069000', 31, 0.01, 11,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', '深入理解Java虚拟机', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (11, '2026-03-17 00:06:47.011000', 32, 0.01, 11,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', '深入理解Java虚拟机', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (12, '2026-03-17 00:17:55.030000', 33, 0.01, 11,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', '深入理解Java虚拟机', 1, 0.01);
INSERT INTO `order_items` (`id`, `created_at`, `order_id`, `price`, `product_id`, `product_image_url`, `product_name`,
`quantity`, `subtotal`)
VALUES (13, '2026-03-17 00:18:19.597000', 34, 0.01, 11,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', '深入理解Java虚拟机', 1, 0.01);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -385,7 +502,6 @@ CREATE TABLE `order_returns`
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `UK_elu6c1jupuay4bgn9gffdsbcx` (`return_no`) UNIQUE KEY `UK_elu6c1jupuay4bgn9gffdsbcx` (`return_no`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -393,11 +509,6 @@ CREATE TABLE `order_returns`
-- Records of order_returns -- Records of order_returns
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `order_returns` (`id`, `admin_remark`, `cancelled_at`, `completed_at`, `created_at`, `description`,
`images`, `order_id`, `reason`, `refund_amount`, `reject_reason`, `return_no`,
`return_tracking`, `reviewed_at`, `shipped_at`, `status`, `updated_at`, `user_id`)
VALUES (1, NULL, NULL, NULL, '2026-03-16 23:10:35.208000', '1', NULL, 23, '商品与描述不符', 0.01, NULL,
'RT1773673835208', NULL, '2026-03-16 23:11:26.080000', NULL, 2, '2026-03-16 23:11:26.096000', 3);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -412,7 +523,7 @@ CREATE TABLE `orders`
`quantity` int NOT NULL DEFAULT '1' COMMENT '购买数量', `quantity` int NOT NULL DEFAULT '1' COMMENT '购买数量',
`total_price` decimal(10, 2) NOT NULL COMMENT '总价', `total_price` decimal(10, 2) NOT NULL COMMENT '总价',
`status` tinyint DEFAULT '1' COMMENT '状态1-待支付2-已支付3-已发货4-已完成5-已取消', `status` tinyint DEFAULT '1' COMMENT '状态1-待支付2-已支付3-已发货4-已完成5-已取消',
`order_type` tinyint DEFAULT '1' COMMENT '订单类型1-普通订单2-限时订单', `order_type` tinyint DEFAULT '1' COMMENT '订单类型1-普通订单2-秒杀订单',
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`completed_at` datetime(6) DEFAULT NULL, `completed_at` datetime(6) DEFAULT NULL,
@@ -437,7 +548,6 @@ CREATE TABLE `orders`
CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 35
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='订单表'; COLLATE = utf8mb4_unicode_ci COMMENT ='订单表';
@@ -445,114 +555,6 @@ CREATE TABLE `orders`
-- Records of orders -- Records of orders
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (18, 3, 1, 1, 7999.00, 3, 2, '2025-07-04 22:02:40', '2026-03-14 16:24:42', NULL, NULL, '', NULL, NULL, NULL,
NULL, NULL, '商家发货', '2026-03-14 16:24:42.039000', NULL, NULL);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (19, 3, 14, 1, 168.00, 4, 1, '2025-07-04 22:03:38', '2026-03-16 23:10:49', '2026-03-16 23:10:49.075000', NULL,
'', NULL, NULL, NULL, NULL, NULL, '用户确认收货', '2026-03-14 16:24:50.513000', NULL, NULL);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (20, 3, 14, 2, 336.00, 4, 1, '2025-07-30 09:07:22', '2026-03-16 23:10:45', '2026-03-16 23:10:45.025000', NULL,
'', '2026-03-13 23:33:50.367000', 'ONLINE', NULL, NULL, NULL, '用户确认收货', '2026-03-14 16:24:48.353000',
NULL, NULL);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (21, 3, 1, 1, 0.01, 4, 3, '2026-03-14 15:49:34', '2026-03-14 16:25:00', '2026-03-14 16:25:00.018000', NULL,
'GB1773474574422850', '2026-03-14 15:54:07.163000', 'ONLINE', NULL, NULL, NULL, '用户确认收货',
'2026-03-14 16:24:37.672000', NULL, 1);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (22, 3, 1, 1, 0.01, 4, 2, '2026-03-14 17:47:30', '2026-03-16 23:10:40', '2026-03-16 23:10:39.916000', NULL,
'FS1773481650367298', '2026-03-14 17:47:37.837000', 'ONLINE', NULL, NULL, NULL, '用户确认收货',
'2026-03-16 23:07:25.085000', 11, NULL);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (23, 3, 1, 1, 0.01, 6, 3, '2026-03-16 21:09:52', '2026-03-16 23:10:35', '2026-03-16 23:06:38.357000', NULL,
'GB1773666592456790', '2026-03-16 21:12:56.248000', 'ONLINE', NULL, NULL, NULL, '用户申请退货',
'2026-03-16 21:26:18.999000', NULL, 2);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (24, 3, 14, 2, 336.00, 4, 1, '2026-03-16 23:07:04', '2026-03-16 23:10:17', '2026-03-16 23:10:17.251000', NULL,
'FS1773673623934239', '2026-03-16 23:07:12.285000', 'ONLINE', NULL, NULL, NULL, '用户确认收货',
'2026-03-16 23:07:22.791000', NULL, NULL);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (25, 15, 1, 1, 0.01, 4, 3, '2026-03-16 23:09:12', '2026-03-16 23:14:48', '2026-03-16 23:14:48.467000', NULL,
'GB1773673751625355', '2026-03-16 23:09:32.485000', 'ONLINE', NULL, NULL, NULL, '用户确认收货',
'2026-03-16 23:11:18.685000', NULL, 2);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (26, 3, 5, 1, 0.01, 2, 3, '2026-03-16 23:36:48', '2026-03-16 23:37:56', NULL, NULL, 'GB1773675408118011',
'2026-03-16 23:37:56.394000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 3);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (27, 15, 5, 1, 0.01, 2, 3, '2026-03-16 23:37:04', '2026-03-16 23:38:20', NULL, NULL, 'GB1773675424159373',
'2026-03-16 23:38:20.390000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 3);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (28, 3, 5, 1, 0.01, 1, 3, '2026-03-16 23:44:35', '2026-03-16 23:44:35', NULL, NULL, 'GB1773675874699140', NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (29, 15, 5, 1, 0.01, 2, 3, '2026-03-16 23:45:05', '2026-03-16 23:46:55', NULL, NULL, 'GB1773675905174079',
'2026-03-16 23:46:54.506000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 4);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (30, 15, 5, 1, 0.01, 2, 3, '2026-03-16 23:47:02', '2026-03-16 23:47:13', NULL, NULL, 'GB1773676022236796',
'2026-03-16 23:47:12.518000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 5);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (31, 3, 11, 1, 0.01, 2, 3, '2026-03-17 00:06:40', '2026-03-17 00:09:22', NULL, NULL, 'GB1773677200059352',
'2026-03-17 00:09:21.854000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 6);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (32, 15, 11, 1, 0.01, 2, 3, '2026-03-17 00:06:47', '2026-03-17 00:09:01', NULL, NULL, 'GB1773677207007351',
'2026-03-17 00:09:01.270000', 'ONLINE', NULL, NULL, NULL, '模拟支付成功 - ONLINE', NULL, NULL, 6);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (33, 3, 11, 1, 0.01, 1, 3, '2026-03-17 00:17:55', '2026-03-17 00:17:55', NULL, NULL, 'GB1773677875020045', NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, 7);
INSERT INTO `orders` (`id`, `user_id`, `product_id`, `quantity`, `total_price`, `status`, `order_type`, `created_at`,
`updated_at`, `completed_at`, `group_no`, `order_no`, `paid_at`, `payment_method`,
`receiver_address`, `receiver_name`, `receiver_phone`, `remark`, `shipped_at`, `flash_sale_id`,
`group_buying_group_id`)
VALUES (34, 15, 11, 1, 0.01, 1, 3, '2026-03-17 00:18:20', '2026-03-17 00:18:20', NULL, NULL, 'GB1773677899592443', NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, 7);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -575,7 +577,6 @@ CREATE TABLE `product_reviews`
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `uk_review_order_user_product` (`order_id`, `user_id`, `product_id`) UNIQUE KEY `uk_review_order_user_product` (`order_id`, `user_id`, `product_id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -583,9 +584,6 @@ CREATE TABLE `product_reviews`
-- Records of product_reviews -- Records of product_reviews
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `product_reviews` (`id`, `admin_reply`, `content`, `created_at`, `order_id`, `product_id`, `rating`,
`replied_at`, `status`, `updated_at`, `user_id`)
VALUES (1, NULL, '13245', '2026-03-14 16:25:09.918000', 21, 1, 5, NULL, 1, '2026-03-16 21:26:27.855000', 3);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -611,7 +609,7 @@ CREATE TABLE `products`
KEY `idx_status` (`status`), KEY `idx_status` (`status`),
KEY `idx_created_at` (`created_at`) KEY `idx_created_at` (`created_at`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 18 AUTO_INCREMENT = 33
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='商品表'; COLLATE = utf8mb4_unicode_ci COMMENT ='商品表';
@@ -621,67 +619,132 @@ CREATE TABLE `products`
BEGIN; BEGIN;
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (1, 'iPhone 15 Pro Max', '苹果最新旗舰手机A17 Pro芯片钛金属设计', 9999.00, 100, VALUES (1, '本地小青菜 500g', '社区周边基地直采小青菜,叶片鲜嫩,适合清炒、煮汤。', 3.99, 300, NULL, 1,
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (2, 'MacBook Pro 16英寸', 'M3 Max芯片36GB内存1TB存储', 25999.00, 50, VALUES (2, '有机上海青 500g', '有机种植上海青,口感清甜,适合家庭日常烹饪。', 5.80, 220, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2026/03/14/4943b3f7cd1048a6ba008a5f163d9cd7.webp', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', '默认分类');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (3, 'iPad Air', '10.9英寸液晶显示屏M1芯片', 4399.00, 80, VALUES (3, '山东黄瓜 500g', '新鲜脆嫩黄瓜,可凉拌、清炒或制作沙拉。', 4.50, 260, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (4, 'AirPods Pro 2', '主动降噪无线耳机,空间音频', 1899.00, 200, VALUES (4, '番茄 500g', '自然成熟番茄,酸甜适中,适合炒蛋、煮汤。', 5.20, 240, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (5, 'Apple Watch Series 9', '健康监测GPS+蜂窝网络', 3199.00, 150, VALUES (5, '西兰花 500g', '精选西兰花,花球紧实,适合清炒或水煮。', 6.90, 180, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (6, '小米电视 65英寸', '4K超高清120Hz刷新率', 2999.00, 60, VALUES (6, '土豆 1kg', '黄心土豆,口感绵密,适合炖煮、清炒。', 4.90, 350, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (7, '戴森吸尘器 V15', '激光显微尘,强劲吸力', 4690.00, 40, VALUES (7, '胡萝卜 1kg', '新鲜胡萝卜,色泽鲜亮,适合炖汤、炒菜。', 5.60, 280, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (8, '美的空调 1.5匹', '变频节能,静音运行', 2599.00, 80, VALUES (8, '紫皮洋葱 1kg', '紫皮洋葱,辛香浓郁,适合炒菜、凉拌。', 4.80, 260, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '新鲜蔬菜');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (9, 'Nike Air Jordan 1', '经典篮球鞋限量版配色1', 1299.00, 119, VALUES (9, '红富士苹果 1kg', '脆甜多汁红富士苹果,适合日常水果补充。', 12.90, 200, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '时令水果');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (10, 'Adidas Ultra Boost', '缓震跑鞋Boost中底', 1599.00, 100, VALUES (10, '赣南脐橙 1kg', '当季脐橙,果肉饱满,汁水充足。', 11.80, 180, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '时令水果');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (11, '深入理解Java虚拟机', 'JVM原理与实践第3版', 89.00, 500, VALUES (11, '海南香蕉 1kg', '自然熟香蕉,香甜软糯,适合早餐和加餐。', 6.90, 240, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2025/07/29/019006fd420548d0b306982931329205.jpg', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '时令水果');
'2026-03-14 17:51:14', NULL);
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (14, '五常大米 10kg', '东北优质大米香甜可口1111', 168.00, 192, VALUES (12, '库尔勒香梨 1kg', '果皮薄、口感脆甜,适合家庭分享。', 13.60, 160, NULL, 1, '2026-05-09 09:46:26',
'/uploads/products/2026/03/14/2e380b9213824856b7d00e0d2b54b436.png', 1, '2026-03-14 17:51:14', '2026-05-09 09:46:26', '时令水果');
'2026-03-16 15:07:03', '默认分类');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`, INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`) `updated_at`, `category`)
VALUES (17, '123', '', 0.01, 10, '', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', '123'); VALUES (13, '精品草莓 500g', '当季新鲜草莓,果香浓郁,建议冷藏保存。', 19.90, 120, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '时令水果');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (14, '阳光玫瑰葡萄 500g', '精选阳光玫瑰葡萄,清甜爽口。', 24.90, 100, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '时令水果');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (15, '鲜鸡蛋 30枚', '农场直供鲜鸡蛋,蛋黄饱满,适合日常烹饪。', 28.80, 180, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (16, '土鸡蛋 20枚', '精选土鸡蛋,蛋香浓郁,适合蒸蛋、煎蛋。', 32.90, 120, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (17, '冷鲜猪五花肉 500g', '冷链配送五花肉,肥瘦相间,适合红烧。', 18.90, 160, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (18, '冷鲜猪里脊 500g', '肉质细嫩,适合炒肉丝、炸猪排。', 21.80, 140, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (19, '鸡胸肉 500g', '低脂鸡胸肉,适合健身餐、沙拉、煎制。', 13.90, 180, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (20, '琵琶腿 1kg', '冷鲜琵琶腿,肉质紧实,适合卤制、烤制。', 22.80, 150, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '肉禽蛋品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (21, '鲜活鲫鱼 500g', '鲜活鲫鱼,适合炖汤、红烧。', 16.80, 90, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '水产海鲜');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (22, '基围虾 500g', '鲜活基围虾,肉质弹嫩,适合白灼、油焖。', 39.90, 80, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '水产海鲜');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (23, '巴沙鱼柳 500g', '去刺巴沙鱼柳,适合煎制、水煮鱼片。', 18.80, 110, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '水产海鲜');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (24, '花蛤 500g', '新鲜花蛤,适合爆炒、煮汤。', 12.90, 100, NULL, 1, '2026-05-09 09:46:26', '2026-05-09 09:46:26',
'水产海鲜');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (25, '五常大米 5kg', '东北五常大米,米香浓郁,适合家庭主食。', 49.90, 130, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '米面粮油');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (26, '东北珍珠米 10kg', '颗粒饱满,口感软糯,适合日常家庭用米。', 78.00, 100, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '米面粮油');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (27, '高筋小麦粉 5kg', '适合制作馒头、面条、包子等面食。', 25.90, 150, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '米面粮油');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (28, '非转基因大豆油 5L', '家用桶装大豆油,适合煎炒烹炸。', 59.90, 120, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '米面粮油');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (29, '鲜牛奶 950ml', '低温鲜牛奶,口感醇厚,建议冷藏保存。', 12.80, 160, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '乳品饮品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (30, '原味酸奶 1kg', '家庭装原味酸奶,口感顺滑,适合早餐。', 16.90, 140, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '乳品饮品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (31, '豆浆 1L', '现磨风味豆浆,适合早餐搭配。', 6.90, 160, NULL, 1, '2026-05-09 09:46:26', '2026-05-09 09:46:26',
'乳品饮品');
INSERT INTO `products` (`id`, `name`, `description`, `price`, `stock`, `image_url`, `status`, `created_at`,
`updated_at`, `category`)
VALUES (32, '鲜榨橙汁 300ml', '冷藏鲜榨橙汁,酸甜清爽。', 9.90, 100, NULL, 1, '2026-05-09 09:46:26',
'2026-05-09 09:46:26', '乳品饮品');
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -725,7 +788,6 @@ CREATE TABLE `user_favorites`
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `uk_favorite_user_product` (`user_id`, `product_id`) UNIQUE KEY `uk_favorite_user_product` (`user_id`, `product_id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
AUTO_INCREMENT = 3
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci; COLLATE = utf8mb4_0900_ai_ci;
@@ -733,8 +795,6 @@ CREATE TABLE `user_favorites`
-- Records of user_favorites -- Records of user_favorites
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `user_favorites` (`id`, `created_at`, `product_id`, `user_id`)
VALUES (2, '2026-03-16 21:26:46.264000', 14, 3);
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------
@@ -773,58 +833,10 @@ CREATE TABLE `users`
-- Records of users -- Records of users
-- ---------------------------- -- ----------------------------
BEGIN; BEGIN;
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (1, 'demo1', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'admin_updated@example.com',
'13888888888', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (2, 'demo2', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'demo2@example.com', '13800138002',
1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`, INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`) `avatar`, `role`)
VALUES (3, 'admin', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'admin@example.com', '13800138000', VALUES (3, 'admin', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'admin@example.com', '13800138000',
1, '2026-03-14 17:51:14', '2026-03-17 00:17:36', '2026-03-17 00:17:36', NULL, ''); 1, '2026-03-14 17:51:14', '2026-05-09 17:55:03', '2026-05-09 17:55:03', NULL, 'ADMIN');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (4, 'testuser1', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'test1@example.com',
'13800138003', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (5, 'testuser2', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'test2@example.com',
'13800138004', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (6, 'testuser3', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'test3@example.com',
'13800138005', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (7, 'testuser4', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'test4@example.com',
'13800138006', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (8, 'testuser5', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'test5@example.com',
'13800138007', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (11, 'student', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', '1231231@gmail.com',
'19889899898', 1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (12, 'student1', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', 'gz1@gmail.com', '19566111010',
1, '2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (13, '123123', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', NULL, NULL, 1,
'2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, NULL, '');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (14, '123', '$2a$10$3V4zVguC/6eJjkuh78JqeufsNnjtHado/xUpGzrdLylF/TjH1ZoQ6', '123@qq.com', '', 1,
'2026-03-14 17:51:14', '2026-03-14 17:51:14', NULL, '', 'USER');
INSERT INTO `users` (`id`, `username`, `password`, `email`, `phone`, `status`, `created_at`, `updated_at`, `last_login`,
`avatar`, `role`)
VALUES (15, '123456', '$2a$10$a7YnUMYMmgWt1mdf6WmyEux/4YPT05rutsab2KLajgGYf60aZfbUW', '1232@qq.com', '13223322332', 1,
'2026-03-16 23:08:57', '2026-03-17 00:18:13', '2026-03-17 00:18:13', '', 'USER');
COMMIT; COMMIT;
-- ---------------------------- -- ----------------------------