优化标签 保证两行

This commit is contained in:
yml2213
2026-05-23 10:14:28 +08:00
parent 40f5252b2e
commit 7a52cecf8c
3 changed files with 374 additions and 127 deletions
@@ -435,8 +435,8 @@ type listingRow struct {
LoginPlatform string LoginPlatform string
RankLevel string RankLevel string
HafCoinAmount int64 HafCoinAmount int64
AssetSummary datatypes.JSON AssetSummary datatypes.JSON `gorm:"column:asset_summary"`
ScreenshotURLS datatypes.JSON ScreenshotURLS datatypes.JSON `gorm:"column:screenshot_urls"`
} }
func rowsToDTO(rows []listingRow) []ListingDTO { func rowsToDTO(rows []listingRow) []ListingDTO {
+351 -113
View File
@@ -1,146 +1,384 @@
-- Development seed: refresh demo listings and rental orders for the mobile app. -- 开发环境测试数据:清空旧业务数据并生成带测试图片的已发布账号。
-- Usage: -- 用法:
-- mysql -uhfb -psecret hfb_sys < backend/seeds/dev_orders.sql
-- 或:
-- docker exec -i hfb-mysql mysql -uhfb -psecret hfb_sys < backend/seeds/dev_orders.sql -- docker exec -i hfb-mysql mysql -uhfb -psecret hfb_sys < backend/seeds/dev_orders.sql
SET NAMES utf8mb4; SET NAMES utf8mb4;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_seed_orders AS SET @old_safe_updates = @@SQL_SAFE_UPDATES;
SELECT id FROM rental_orders; SET SQL_SAFE_UPDATES = 0;
DELETE FROM disputes WHERE order_id IN (SELECT id FROM tmp_seed_orders); DELETE FROM disputes;
DELETE FROM handoff_records WHERE order_id IN (SELECT id FROM tmp_seed_orders); DELETE FROM handoff_records;
DELETE FROM wallet_ledger WHERE order_id IN (SELECT id FROM tmp_seed_orders); DELETE FROM wallet_ledger;
DELETE FROM notifications DELETE FROM notifications WHERE biz_type IN ('order', 'listing', 'listing_review', 'listing_admin') OR biz_type = '';
WHERE biz_type = 'order' OR biz_id IN (SELECT id FROM tmp_seed_orders);
DELETE FROM rental_orders; DELETE FROM rental_orders;
DROP TEMPORARY TABLE IF EXISTS tmp_seed_orders; DELETE FROM rental_listings;
DELETE FROM game_accounts;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_seed_accounts AS DELETE FROM user_realname WHERE user_id IN (SELECT id FROM users WHERE phone IN ('13800000001', '13800000002', '13800000003', '13900000001'));
SELECT id DELETE FROM wallet_accounts WHERE user_id IN (SELECT id FROM users WHERE phone IN ('13800000001', '13800000002', '13800000003', '13900000001'));
FROM game_accounts DELETE FROM users WHERE phone IN ('13800000001', '13800000002', '13800000003', '13900000001');
WHERE title LIKE '测试发布-%' OR title LIKE '测试订单-%' OR title LIKE '纯币%';
DELETE FROM rental_listings WHERE account_id IN (SELECT id FROM tmp_seed_accounts); ALTER TABLE game_accounts AUTO_INCREMENT = 1;
DELETE FROM game_accounts WHERE id IN (SELECT id FROM tmp_seed_accounts); ALTER TABLE rental_listings AUTO_INCREMENT = 1;
DROP TEMPORARY TABLE IF EXISTS tmp_seed_accounts; ALTER TABLE rental_orders AUTO_INCREMENT = 1;
ALTER TABLE handoff_records AUTO_INCREMENT = 1;
ALTER TABLE disputes AUTO_INCREMENT = 1;
ALTER TABLE wallet_ledger AUTO_INCREMENT = 1;
ALTER TABLE notifications AUTO_INCREMENT = 1;
SET SQL_SAFE_UPDATES = @old_safe_updates;
INSERT INTO users (phone, nickname, realname_status, risk_status, credit_score, status) INSERT INTO users (phone, nickname, realname_status, risk_status, credit_score, status)
VALUES VALUES
('13800000001', '测试号主A', 'verified', 'normal', 100, 'active'), ('13800000001', '测试号主A', 'verified', 'normal', 100, 'active'),
('13800000002', '测试号主B', 'verified', 'normal', 100, 'active'), ('13800000002', '测试号主B', 'verified', 'normal', 100, 'active'),
('13900000001', '测试租客A', 'verified', 'normal', 100, 'active') ('13800000003', '测试号主C', 'verified', 'normal', 100, 'active'),
ON DUPLICATE KEY UPDATE ('13900000001', '测试租客A', 'verified', 'normal', 100, 'active');
nickname = VALUES(nickname),
realname_status = VALUES(realname_status),
risk_status = VALUES(risk_status),
credit_score = VALUES(credit_score),
status = VALUES(status),
updated_at = CURRENT_TIMESTAMP;
SELECT id INTO @owner_a FROM users WHERE phone = '13800000001'; SELECT id INTO @owner_a FROM users WHERE phone = '13800000001';
SELECT id INTO @owner_b FROM users WHERE phone = '13800000002'; SELECT id INTO @owner_b FROM users WHERE phone = '13800000002';
SELECT id INTO @owner_c FROM users WHERE phone = '13800000003';
SELECT id INTO @renter_a FROM users WHERE phone = '13900000001'; SELECT id INTO @renter_a FROM users WHERE phone = '13900000001';
INSERT INTO user_realname (user_id, provider, provider_order_no, status, masked_name, masked_id_no, verified_at)
VALUES
(@owner_a, 'mock', 'seed-owner-a', 'verified', '测*A', '110***********0001', NOW()),
(@owner_b, 'mock', 'seed-owner-b', 'verified', '测*B', '110***********0002', NOW()),
(@owner_c, 'mock', 'seed-owner-c', 'verified', '测*C', '110***********0003', NOW()),
(@renter_a, 'mock', 'seed-renter-a', 'verified', '测*客', '110***********1001', NOW());
INSERT INTO wallet_accounts (user_id, available_balance, frozen_balance, status) INSERT INTO wallet_accounts (user_id, available_balance, frozen_balance, status)
VALUES VALUES
(@owner_a, 0, 0, 'active'), (@owner_a, 0.00, 0.00, 'active'),
(@owner_b, 0, 0, 'active'), (@owner_b, 0.00, 0.00, 'active'),
(@renter_a, 2000, 0, 'active') (@owner_c, 0.00, 0.00, 'active'),
ON DUPLICATE KEY UPDATE (@renter_a, 5000.00, 0.00, 'active');
available_balance = VALUES(available_balance),
frozen_balance = VALUES(frozen_balance),
status = VALUES(status),
updated_at = CURRENT_TIMESTAMP;
INSERT INTO game_accounts INSERT INTO game_accounts
(owner_id, game_name, server_region, login_platform, title, description, rank_level, haf_coin_amount, asset_summary, screenshot_urls, status) (owner_id, game_name, server_region, login_platform, title, description, rank_level, haf_coin_amount, asset_summary, screenshot_urls, status, created_at, updated_at)
VALUES VALUES
(@owner_a, '三角洲行动', 'QQ', '扫码', '纯币300M/6格/6体/6负/4六甲/6六头', (
'扫码交接,保险 2*3,30M 日损耗,适合高强度体验。', @owner_a, '三角洲行动', 'QQ', '扫码',
'纯币300M/6格/6体/6负/4六甲/6六头',
'扫码交接,保险 2*3,资源充足,适合高强度体验。',
'黑鹰', 300000000, '黑鹰', 300000000,
JSON_OBJECT('haf_coin_wan', 30000, 'total_asset_wan', 33700, 'season_insurance', '2*3', 'stamina_level', '6级', 'load_level', '6级', 'daily_loss', '30M', 'ratio', 6, 'price', 5000, 'settlement_amount', 5000, 'rent_days', 7, 'login_method', '扫码', 'online_time', JSON_OBJECT('start', '10:00', 'end', '23:00'), 'common_regions', JSON_ARRAY('广东', '上海'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 80, 'mode', '收费'), JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 6, 'mode', '收费'), JSON_OBJECT('key', 'armor6', 'label', '6甲数量', 'quantity', 4, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('龙牙', '信条'), 'operator', JSON_ARRAY('威龙-凌霄戍卫'), 'weapon', JSON_ARRAY('M4A1棱镜攻势', 'K416命运')), 'screenshots', JSON_OBJECT('coin', 'https://picsum.photos/seed/dev-account-1-coin/960/540', 'gameId', 'https://picsum.photos/seed/dev-account-1-game/960/540', 'totalAsset', 'https://picsum.photos/seed/dev-account-1-asset/960/540')), JSON_OBJECT(
JSON_ARRAY('https://picsum.photos/seed/dev-account-1-coin/960/540', 'https://picsum.photos/seed/dev-account-1-asset/960/540'), 'published'), 'face_owner', '',
(@owner_a, '三角洲行动', '微信', '账号密码', '纯币120M/4格/5体/5负/2六头', 'total_asset_wan', 33700,
'secret_kd', 2.8,
'fire_level', 58,
'season_insurance', '2*3',
'stamina_level', '6级',
'load_level', '6级',
'common_regions', JSON_ARRAY('广东', '上海'),
'online_time', JSON_OBJECT('start', '10:00', 'end', '23:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 80, 'mode', '收费'),
JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 6, 'mode', '收费'),
JSON_OBJECT('key', 'armor6', 'label', '6甲数量', 'quantity', 4, 'mode', '收费'),
JSON_OBJECT('key', 'level6Ammo', 'label', '6级子弹', 'quantity', 360, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('龙牙', '信条'),
'operator', JSON_ARRAY('威龙-凌霄戍卫', '红狼-蚀金玫瑰'),
'weapon', JSON_ARRAY('M4A1棱镜攻势', 'K416命运')
),
'remark', '部分仓库材料请勿使用,下单后会再次提醒。'
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-001-coin/960/540',
'https://picsum.photos/seed/hfb-listing-001-id/960/540',
'https://picsum.photos/seed/hfb-listing-001-asset/960/540',
'https://picsum.photos/seed/hfb-listing-001-security/960/540',
'https://picsum.photos/seed/hfb-listing-001-skin/960/540'
),
'published', NOW() - INTERVAL 80 MINUTE, NOW() - INTERVAL 80 MINUTE
),
(
@owner_a, '三角洲行动', '微信', '账号密码',
'纯币120M/4格/5体/5负/2六头',
'账密登录,低押金,保险 2*2,常用登录地江苏。', '账密登录,低押金,保险 2*2,常用登录地江苏。',
'钻石', 120000000, '钻石', 120000000,
JSON_OBJECT('haf_coin_wan', 12000, 'total_asset_wan', 13800, 'season_insurance', '2*2', 'stamina_level', '5级', 'load_level', '5级', 'daily_loss', '20M', 'ratio', 5, 'price', 2400, 'settlement_amount', 2400, 'rent_days', 3, 'login_method', '账号密码', 'online_time', JSON_OBJECT('start', '12:00', 'end', '24:00'), 'common_regions', JSON_ARRAY('江苏'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 30, 'mode', '收费'), JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 2, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('怜悯'), 'operator', JSON_ARRAY('露娜-黑天际线'), 'weapon', JSON_ARRAY('SCAR-H电玩高手')), 'screenshots', JSON_OBJECT('coin', 'https://picsum.photos/seed/dev-account-2-coin/960/540', 'gameId', 'https://picsum.photos/seed/dev-account-2-game/960/540', 'totalAsset', 'https://picsum.photos/seed/dev-account-2-asset/960/540')), JSON_OBJECT(
JSON_ARRAY('https://picsum.photos/seed/dev-account-2-coin/960/540', 'https://picsum.photos/seed/dev-account-2-asset/960/540'), 'published'), 'face_owner', '',
(@owner_b, '三角洲行动', 'Steam', '扫码', '纯币60M/2格/4体/4负/1体验卡', 'total_asset_wan', 13800,
'可包夜,保险 2*1,适合短租搬砖。', 'secret_kd', 1.9,
'fire_level', 46,
'season_insurance', '2*2',
'stamina_level', '5级',
'load_level', '5级',
'common_regions', JSON_ARRAY('江苏', '浙江'),
'online_time', JSON_OBJECT('start', '12:00', 'end', '24:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 30, 'mode', '收费'),
JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 2, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('怜悯'),
'operator', JSON_ARRAY('露娜-黑天际线'),
'weapon', JSON_ARRAY('SCAR-H电玩高手')
),
'remark', ''
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-002-coin/960/540',
'https://picsum.photos/seed/hfb-listing-002-id/960/540',
'https://picsum.photos/seed/hfb-listing-002-asset/960/540',
'https://picsum.photos/seed/hfb-listing-002-security/960/540',
'https://picsum.photos/seed/hfb-listing-002-skin/960/540'
),
'published', NOW() - INTERVAL 70 MINUTE, NOW() - INTERVAL 70 MINUTE
),
(
@owner_b, '三角洲行动', 'Steam', '扫码',
'纯币60M/2格/4体/4负/1体验卡',
'可包夜,保险 2*1,适合短租。',
'铂金', 60000000, '铂金', 60000000,
JSON_OBJECT('haf_coin_wan', 6000, 'total_asset_wan', 7200, 'season_insurance', '2*1', 'stamina_level', '4级', 'load_level', '4级', 'daily_loss', '10M', 'ratio', 4, 'price', 1500, 'settlement_amount', 1500, 'rent_days', 1, 'login_method', '扫码', 'online_time', JSON_OBJECT('start', '18:00', 'end', '02:00'), 'common_regions', JSON_ARRAY('四川', '重庆'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 12, 'mode', '收费'), JSON_OBJECT('key', 'gridCard9', 'label', '9格体验卡', 'quantity', 1, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('暗星'), 'operator', JSON_ARRAY('赛伊德'), 'weapon', JSON_ARRAY('Vector美杜莎')), 'screenshots', JSON_OBJECT('coin', 'https://picsum.photos/seed/dev-account-3-coin/960/540', 'gameId', 'https://picsum.photos/seed/dev-account-3-game/960/540', 'totalAsset', 'https://picsum.photos/seed/dev-account-3-asset/960/540')), JSON_OBJECT(
JSON_ARRAY('https://picsum.photos/seed/dev-account-3-coin/960/540', 'https://picsum.photos/seed/dev-account-3-asset/960/540'), 'published'), 'face_owner', '',
(@owner_b, '三角洲行动', 'QQ', '账号密码', '纯币500M/9格/7体/7负/10六头', 'total_asset_wan', 7200,
'secret_kd', 1.4,
'fire_level', 39,
'season_insurance', '2*1',
'stamina_level', '4级',
'load_level', '4级',
'common_regions', JSON_ARRAY('四川', '重庆'),
'online_time', JSON_OBJECT('start', '18:00', 'end', '02:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 12, 'mode', '收费'),
JSON_OBJECT('key', 'gridCard9', 'label', '9格体验卡', 'quantity', 1, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('暗星'),
'operator', JSON_ARRAY('赛伊德'),
'weapon', JSON_ARRAY('Vector美杜莎')
),
'remark', ''
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-003-coin/960/540',
'https://picsum.photos/seed/hfb-listing-003-id/960/540',
'https://picsum.photos/seed/hfb-listing-003-asset/960/540',
'https://picsum.photos/seed/hfb-listing-003-security/960/540'
),
'published', NOW() - INTERVAL 60 MINUTE, NOW() - INTERVAL 60 MINUTE
),
(
@owner_b, '三角洲行动', 'QQ', '账号密码',
'纯币500M/9格/7体/7负/10六头',
'账密交接,高段位,保险 3*3,皮肤资源较多。', '账密交接,高段位,保险 3*3,皮肤资源较多。',
'三角洲巅峰', 500000000, '三角洲巅峰', 500000000,
JSON_OBJECT('haf_coin_wan', 50000, 'total_asset_wan', 58600, 'season_insurance', '3*3', 'stamina_level', '7级', 'load_level', '7级', 'daily_loss', '30M', 'ratio', 7, 'price', 7142.86, 'settlement_amount', 7142.86, 'rent_days', 7, 'login_method', '账号密码', 'online_time', JSON_OBJECT('start', '09:00', 'end', '23:30'), 'common_regions', JSON_ARRAY('北京', '浙江'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 120, 'mode', '收费'), JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 10, 'mode', '收费'), JSON_OBJECT('key', 'level6Ammo', 'label', '6级子弹', 'quantity', 300, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('坠星者', '处刑者'), 'operator', JSON_ARRAY('威龙-铁面判官', '红狼-蚀金玫瑰'), 'weapon', JSON_ARRAY('M7棱镜攻势S2', 'KC17-造物纪元')), 'screenshots', JSON_OBJECT('coin', 'https://picsum.photos/seed/dev-account-4-coin/960/540', 'gameId', 'https://picsum.photos/seed/dev-account-4-game/960/540', 'totalAsset', 'https://picsum.photos/seed/dev-account-4-asset/960/540')), JSON_OBJECT(
JSON_ARRAY('https://picsum.photos/seed/dev-account-4-coin/960/540', 'https://picsum.photos/seed/dev-account-4-asset/960/540'), 'published'), 'face_owner', '',
(@owner_a, '三角洲行动', '微信', '扫码', '测试订单-待交接 微信 黑鹰 20000万', 'total_asset_wan', 58600,
'测试订单关联账号:待交接。', 'secret_kd', 4.2,
'黑鹰', 200000000, 'fire_level', 72,
JSON_OBJECT('haf_coin_wan', 20000, 'season_insurance', '2*3', 'stamina_level', '6级', 'load_level', '5级', 'daily_loss', '20M', 'ratio', 6, 'login_method', '扫码', 'common_regions', JSON_ARRAY('广东'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 50, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('影锋'), 'operator', JSON_ARRAY('威龙-吴彦祖'), 'weapon', JSON_ARRAY('QBZ95王牌之剑'))), 'season_insurance', '3*3',
JSON_ARRAY(), 'rented'), 'stamina_level', '7级',
(@owner_b, '三角洲行动', 'QQ', '账号密码', '测试订单-租赁中 QQ 钻石 10000万', 'load_level', '7级',
'测试订单关联账号:租赁中。', 'common_regions', JSON_ARRAY('北京', '浙江'),
'钻石', 100000000, 'online_time', JSON_OBJECT('start', '09:00', 'end', '23:30'),
JSON_OBJECT('haf_coin_wan', 10000, 'season_insurance', '2*2', 'stamina_level', '5级', 'load_level', '5级', 'daily_loss', '20M', 'ratio', 5, 'login_method', '账号密码', 'common_regions', JSON_ARRAY('上海'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 20, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('黑海'), 'operator', JSON_ARRAY('骇爪-水墨云图'), 'weapon', JSON_ARRAY('AUG气象感应'))), 'ban_record', '无封禁记录',
JSON_ARRAY(), 'rented'), 'resources', JSON_ARRAY(
(@owner_a, '三角洲行动', 'Steam', '扫码', '测试订单-待归还 Steam 黄金 5000万', JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 120, 'mode', '收费'),
'测试订单关联账号:待归还确认。', JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 10, 'mode', '收费'),
'黄金', 50000000, JSON_OBJECT('key', 'armor6', 'label', '6甲数量', 'quantity', 8, 'mode', '收费'),
JSON_OBJECT('haf_coin_wan', 5000, 'season_insurance', '2*1', 'stamina_level', '3级', 'load_level', '3级', 'daily_loss', '10M', 'ratio', 4, 'login_method', '扫码', 'common_regions', JSON_ARRAY('湖北'), 'resources', JSON_ARRAY(JSON_OBJECT('key', 'gridCard9', 'label', '9格体验卡', 'quantity', 1, 'mode', '收费')), 'skin_groups', JSON_OBJECT('melee', JSON_ARRAY('北极星'), 'operator', JSON_ARRAY('蜂医-送葬人'), 'weapon', JSON_ARRAY('MP7电玩高手S2'))), JSON_OBJECT('key', 'level6Ammo', 'label', '6级子弹', 'quantity', 800, 'mode', '收费')
JSON_ARRAY(), 'rented'); ),
'skin_groups', JSON_OBJECT(
SELECT id INTO @account_pub_1 FROM game_accounts WHERE title = '纯币300M/6格/6体/6负/4六甲/6六头' ORDER BY id DESC LIMIT 1; 'melee', JSON_ARRAY('坠星者', '处刑者'),
SELECT id INTO @account_pub_2 FROM game_accounts WHERE title = '纯币120M/4格/5体/5负/2六头' ORDER BY id DESC LIMIT 1; 'operator', JSON_ARRAY('威龙-铁面判官', '红狼-蚀金玫瑰'),
SELECT id INTO @account_pub_3 FROM game_accounts WHERE title = '纯币60M/2格/4体/4负/1体验卡' ORDER BY id DESC LIMIT 1; 'weapon', JSON_ARRAY('M7棱镜攻势S2', 'KC17-造物纪元')
SELECT id INTO @account_pub_4 FROM game_accounts WHERE title = '纯币500M/9格/7体/7负/10六头' ORDER BY id DESC LIMIT 1; ),
SELECT id INTO @account_order_1 FROM game_accounts WHERE title = '测试订单-待交接 微信 黑鹰 20000万' ORDER BY id DESC LIMIT 1; 'remark', '高价值账号,需按平台流程交接。'
SELECT id INTO @account_order_2 FROM game_accounts WHERE title = '测试订单-租赁中 QQ 钻石 10000万' ORDER BY id DESC LIMIT 1; ),
SELECT id INTO @account_order_3 FROM game_accounts WHERE title = '测试订单-待归还 Steam 黄金 5000万' ORDER BY id DESC LIMIT 1; JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-004-coin/960/540',
'https://picsum.photos/seed/hfb-listing-004-id/960/540',
'https://picsum.photos/seed/hfb-listing-004-asset/960/540',
'https://picsum.photos/seed/hfb-listing-004-security/960/540',
'https://picsum.photos/seed/hfb-listing-004-skin/960/540'
),
'published', NOW() - INTERVAL 50 MINUTE, NOW() - INTERVAL 50 MINUTE
),
(
@owner_c, '三角洲行动', '微信', '扫码',
'纯币180M/6格/6体/5负/80发AWM',
'扫码交接,资源适中,适合三日租。',
'黑鹰', 180000000,
JSON_OBJECT(
'face_owner', '',
'total_asset_wan', 21600,
'secret_kd', 2.1,
'fire_level', 53,
'season_insurance', '2*3',
'stamina_level', '6级',
'load_level', '5级',
'common_regions', JSON_ARRAY('上海', '安徽'),
'online_time', JSON_OBJECT('start', '11:00', 'end', '23:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 80, 'mode', '赠送'),
JSON_OBJECT('key', 'kit5', 'label', '5级全装套数量', 'quantity', 6, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('影锋'),
'operator', JSON_ARRAY('骇爪-水墨云图'),
'weapon', JSON_ARRAY('QBZ95王牌之剑', 'AUG气象感应')
),
'remark', 'AWM 子弹赠送,其他消耗品按规则扣费。'
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-005-coin/960/540',
'https://picsum.photos/seed/hfb-listing-005-id/960/540',
'https://picsum.photos/seed/hfb-listing-005-asset/960/540',
'https://picsum.photos/seed/hfb-listing-005-security/960/540'
),
'published', NOW() - INTERVAL 40 MINUTE, NOW() - INTERVAL 40 MINUTE
),
(
@owner_c, '三角洲行动', 'QQ', '扫码',
'纯币90M/4格/5体/4负/3五级套',
'短租低价,保险 2*2,适合试号。',
'铂金', 90000000,
JSON_OBJECT(
'face_owner', '',
'total_asset_wan', 10200,
'secret_kd', 1.7,
'fire_level', 44,
'season_insurance', '2*2',
'stamina_level', '5级',
'load_level', '4级',
'common_regions', JSON_ARRAY('河南', '山东'),
'online_time', JSON_OBJECT('start', '14:00', 'end', '01:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'kit5', 'label', '5级全装套数量', 'quantity', 3, 'mode', '收费'),
JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 1, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('北极星'),
'operator', JSON_ARRAY('蜂医-送葬人'),
'weapon', JSON_ARRAY('MP7电玩高手S2')
),
'remark', ''
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-006-coin/960/540',
'https://picsum.photos/seed/hfb-listing-006-id/960/540',
'https://picsum.photos/seed/hfb-listing-006-asset/960/540',
'https://picsum.photos/seed/hfb-listing-006-security/960/540'
),
'published', NOW() - INTERVAL 30 MINUTE, NOW() - INTERVAL 30 MINUTE
),
(
@owner_a, '三角洲行动', 'Steam', '账号密码',
'纯币260M/6格/6体/6负/皮肤多',
'Steam 账密,常用地北京/天津,皮肤组合较完整。',
'黑鹰', 260000000,
JSON_OBJECT(
'face_owner', '',
'total_asset_wan', 30100,
'secret_kd', 3.2,
'fire_level', 61,
'season_insurance', '2*3',
'stamina_level', '6级',
'load_level', '6级',
'common_regions', JSON_ARRAY('北京', '天津'),
'online_time', JSON_OBJECT('start', '09:30', 'end', '22:30'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 48, 'mode', '收费'),
JSON_OBJECT('key', 'armor6', 'label', '6甲数量', 'quantity', 3, 'mode', '收费'),
JSON_OBJECT('key', 'helmet6', 'label', '6头数量', 'quantity', 4, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('赤枭', '黑海'),
'operator', JSON_ARRAY('威龙-壮志凌云', '蜂医-危险物质'),
'weapon', JSON_ARRAY('AS Val悬赏令', 'K416命运', 'AUG气象感应')
),
'remark', ''
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-007-coin/960/540',
'https://picsum.photos/seed/hfb-listing-007-id/960/540',
'https://picsum.photos/seed/hfb-listing-007-asset/960/540',
'https://picsum.photos/seed/hfb-listing-007-security/960/540',
'https://picsum.photos/seed/hfb-listing-007-skin/960/540'
),
'published', NOW() - INTERVAL 20 MINUTE, NOW() - INTERVAL 20 MINUTE
),
(
@owner_b, '三角洲行动', '微信', '账号密码',
'纯币360M/9格/7体/6负/赠送六级弹',
'账密登录,保险 3*3,赠送部分六级弹。',
'三角洲巅峰', 360000000,
JSON_OBJECT(
'face_owner', '',
'total_asset_wan', 42100,
'secret_kd', 3.8,
'fire_level', 68,
'season_insurance', '3*3',
'stamina_level', '7级',
'load_level', '6级',
'common_regions', JSON_ARRAY('福建', '广东'),
'online_time', JSON_OBJECT('start', '10:00', 'end', '24:00'),
'ban_record', '无封禁记录',
'resources', JSON_ARRAY(
JSON_OBJECT('key', 'level6Ammo', 'label', '6级子弹', 'quantity', 520, 'mode', '赠送'),
JSON_OBJECT('key', 'awmAmmo', 'label', 'AWM子弹', 'quantity', 100, 'mode', '收费'),
JSON_OBJECT('key', 'gridCard9', 'label', '9格体验卡', 'quantity', 2, 'mode', '收费')
),
'skin_groups', JSON_OBJECT(
'melee', JSON_ARRAY('电锯惊魂', '处刑者'),
'operator', JSON_ARRAY('露娜-古墓丽影劳拉', '红狼-电锯惊魂'),
'weapon', JSON_ARRAY('M250电玩高手S2', '腾龙气象感应')
),
'remark', '六级弹赠送数量以下单截图为准。'
),
JSON_ARRAY(
'https://picsum.photos/seed/hfb-listing-008-coin/960/540',
'https://picsum.photos/seed/hfb-listing-008-id/960/540',
'https://picsum.photos/seed/hfb-listing-008-asset/960/540',
'https://picsum.photos/seed/hfb-listing-008-security/960/540',
'https://picsum.photos/seed/hfb-listing-008-skin/960/540'
),
'published', NOW() - INTERVAL 10 MINUTE, NOW() - INTERVAL 10 MINUTE
);
INSERT INTO rental_listings INSERT INTO rental_listings
(account_id, owner_id, price_hourly, price_daily, price_weekly, deposit_amount, min_rent_hours, max_rent_hours, status, review_status, published_at) (account_id, owner_id, price_hourly, price_daily, price_weekly, deposit_amount, min_rent_hours, max_rent_hours, status, review_status, published_at, created_at, updated_at)
VALUES SELECT id, owner_id, 29.76, 714.29, 5000.00, 120.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 80 MINUTE, created_at, updated_at
(@account_pub_1, @owner_a, 8.80, 88.00, 520.00, 120.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 10 MINUTE), FROM game_accounts WHERE title = '纯币300M/6格/6体/6负/4六甲/6六头'
(@account_pub_2, @owner_a, 5.50, 55.00, 330.00, 60.00, 24, 72, 'published', 'approved', NOW() - INTERVAL 20 MINUTE), UNION ALL
(@account_pub_3, @owner_b, 3.90, 39.00, 220.00, 80.00, 8, 24, 'published', 'approved', NOW() - INTERVAL 30 MINUTE), SELECT id, owner_id, 33.33, 800.00, 2400.00, 60.00, 24, 72, 'published', 'approved', NOW() - INTERVAL 70 MINUTE, created_at, updated_at
(@account_pub_4, @owner_b, 12.80, 128.00, 760.00, 180.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 40 MINUTE), FROM game_accounts WHERE title = '纯币120M/4格/5体/5负/2六头'
(@account_order_1, @owner_a, 7.00, 70.00, 420.00, 100.00, 24, 72, 'rented', 'approved', NOW() - INTERVAL 50 MINUTE), UNION ALL
(@account_order_2, @owner_b, 6.00, 60.00, 360.00, 80.00, 24, 168, 'rented', 'approved', NOW() - INTERVAL 60 MINUTE), SELECT id, owner_id, 62.50, 1500.00, 1500.00, 80.00, 8, 24, 'published', 'approved', NOW() - INTERVAL 60 MINUTE, created_at, updated_at
(@account_order_3, @owner_a, 3.00, 30.00, 180.00, 50.00, 8, 24, 'rented', 'approved', NOW() - INTERVAL 70 MINUTE); FROM game_accounts WHERE title = '纯币60M/2格/4体/4负/1体验卡'
UNION ALL
SELECT id INTO @listing_order_1 FROM rental_listings WHERE account_id = @account_order_1 ORDER BY id DESC LIMIT 1; SELECT id, owner_id, 42.52, 1020.41, 7142.86, 180.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 50 MINUTE, created_at, updated_at
SELECT id INTO @listing_order_2 FROM rental_listings WHERE account_id = @account_order_2 ORDER BY id DESC LIMIT 1; FROM game_accounts WHERE title = '纯币500M/9格/7体/7负/10六头'
SELECT id INTO @listing_order_3 FROM rental_listings WHERE account_id = @account_order_3 ORDER BY id DESC LIMIT 1; UNION ALL
SELECT id, owner_id, 50.00, 1200.00, 3600.00, 100.00, 24, 72, 'published', 'approved', NOW() - INTERVAL 40 MINUTE, created_at, updated_at
INSERT INTO rental_orders FROM game_accounts WHERE title = '纯币180M/6格/6体/5负/80发AWM'
(order_no, listing_id, account_id, owner_id, renter_id, rent_start_at, rent_end_at, rent_hours, rent_amount, deposit_amount, platform_fee, account_snapshot, status, handoff_status, settlement_status, created_at, updated_at) UNION ALL
VALUES SELECT id, owner_id, 31.25, 750.00, 750.00, 50.00, 8, 24, 'published', 'approved', NOW() - INTERVAL 30 MINUTE, created_at, updated_at
('TEST202605230001', @listing_order_1, @account_order_1, @owner_a, @renter_a, NULL, NULL, 24, 70.00, 100.00, 7.00, FROM game_accounts WHERE title = '纯币90M/4格/5体/4负/3五级套'
JSON_OBJECT('title', '测试订单-待交接 微信 黑鹰 20000万', 'server_region', '微信', 'login_platform', '扫码', 'haf_coin_amount', 200000000), UNION ALL
'pending_handoff', 'pending_owner', 'unsettled', NOW(), NOW()), SELECT id, owner_id, 25.79, 619.05, 4333.33, 120.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 20 MINUTE, created_at, updated_at
('TEST202605230002', @listing_order_2, @account_order_2, @owner_b, @renter_a, NOW() - INTERVAL 2 HOUR, NOW() + INTERVAL 22 HOUR, 24, 60.00, 80.00, 6.00, FROM game_accounts WHERE title = '纯币260M/6格/6体/6负/皮肤多'
JSON_OBJECT('title', '测试订单-租赁中 QQ 钻石 10000万', 'server_region', 'QQ', 'login_platform', '账号密码', 'haf_coin_amount', 100000000), UNION ALL
'renting', 'received', 'unsettled', NOW() - INTERVAL 2 HOUR, NOW() - INTERVAL 90 MINUTE), SELECT id, owner_id, 35.71, 857.14, 6000.00, 160.00, 24, 168, 'published', 'approved', NOW() - INTERVAL 10 MINUTE, created_at, updated_at
('TEST202605230003', @listing_order_3, @account_order_3, @owner_a, @renter_a, NOW() - INTERVAL 10 HOUR, NOW() - INTERVAL 2 HOUR, 8, 30.00, 50.00, 3.00, FROM game_accounts WHERE title = '纯币360M/9格/7体/6负/赠送六级弹';
JSON_OBJECT('title', '测试订单-待归还 Steam 黄金 5000万', 'server_region', 'Steam', 'login_platform', '扫码', 'haf_coin_amount', 50000000),
'pending_return_confirm', 'pending_owner_return_confirm', 'unsettled', NOW() - INTERVAL 10 HOUR, NOW() - INTERVAL 15 MINUTE);
SELECT id INTO @order_1 FROM rental_orders WHERE order_no = 'TEST202605230001';
SELECT id INTO @order_2 FROM rental_orders WHERE order_no = 'TEST202605230002';
SELECT id INTO @order_3 FROM rental_orders WHERE order_no = 'TEST202605230003';
INSERT INTO handoff_records
(order_id, from_user_id, to_user_id, type, content, attachment_urls, confirmed_by_renter_at, confirmed_by_owner_at)
VALUES
(@order_2, @owner_b, @renter_a, 'owner_submit', '账密已通过群聊交接,请按约定时间使用。', JSON_ARRAY(), NOW() - INTERVAL 90 MINUTE, NULL),
(@order_3, @owner_a, @renter_a, 'owner_submit', '扫码已完成,账号可正常进入游戏。', JSON_ARRAY(), NOW() - INTERVAL 9 HOUR, NULL),
(@order_3, @renter_a, @owner_a, 'renter_return', '已退出账号,未消耗保留物资。', JSON_ARRAY(), NULL, NULL);
INSERT INTO notifications (user_id, type, title, content, biz_type, biz_id, created_at) INSERT INTO notifications (user_id, type, title, content, biz_type, biz_id, created_at)
VALUES SELECT rental_listings.owner_id, 'listing_review', '发布审核通过', CONCAT(game_accounts.title, ' 已上架。'), 'listing', rental_listings.id, rental_listings.updated_at
(@owner_a, 'order', '收到新的租号订单', '测试订单 TEST202605230001 等待你提交交接说明。', 'order', @order_1, NOW()), FROM rental_listings
(@renter_a, 'order', '订单已创建', '测试订单 TEST202605230001 已创建,请等待号主交接。', 'order', @order_1, NOW()), JOIN game_accounts ON game_accounts.id = rental_listings.account_id;
(@renter_a, 'order', '订单租赁中', '测试订单 TEST202605230002 已进入租赁中。', 'order', @order_2, NOW() - INTERVAL 90 MINUTE),
(@owner_a, 'order', '买家已提交归还', '测试订单 TEST202605230003 等待你确认归还。', 'order', @order_3, NOW() - INTERVAL 15 MINUTE);
+15 -6
View File
@@ -368,9 +368,9 @@
.mobile-card { .mobile-card {
display: grid; display: grid;
grid-template-columns: 132px minmax(0, 1fr); grid-template-columns: 132px minmax(0, 1fr);
grid-template-rows: 132px 62px; grid-template-rows: 132px 56px;
gap: 10px 12px; gap: 10px 12px;
min-height: 230px; min-height: 222px;
border-radius: 16px; border-radius: 16px;
background: #ffffff; background: #ffffff;
padding: 12px; padding: 12px;
@@ -512,27 +512,36 @@
.card-chip-row { .card-chip-row {
grid-column: 1 / -1; grid-column: 1 / -1;
align-content: flex-start; align-content: flex-start;
row-gap: 6px;
column-gap: 6px;
height: 56px;
margin-top: 0; margin-top: 0;
min-height: 62px; overflow: hidden;
} }
.card-chip-row span { .card-chip-row span {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
min-height: 25px; max-width: 100%;
height: 25px;
min-width: 0;
border: 1px solid #ff8a1f; border: 1px solid #ff8a1f;
border-radius: 4px; border-radius: 4px;
color: #ff7900; color: #ff7900;
padding: 0 5px; padding: 0 5px;
font-size: 11.5px; font-size: 11.5px;
font-weight: 700; font-weight: 700;
line-height: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
@media (max-width: 374px) { @media (max-width: 374px) {
.mobile-card { .mobile-card {
grid-template-columns: 112px minmax(0, 1fr); grid-template-columns: 112px minmax(0, 1fr);
grid-template-rows: 112px 62px; grid-template-rows: 112px 56px;
min-height: 210px; min-height: 202px;
} }
.card-cover { .card-cover {