feat: add dashboard and virtual pay enhancements

This commit is contained in:
王鹏
2026-07-29 14:34:54 +08:00
parent 2250f744d1
commit 349f1c0374
55 changed files with 3085 additions and 213 deletions

View File

@@ -0,0 +1,46 @@
-- 首页统计查询索引(可重复执行)
SET @dashboard_index_sql = (
SELECT IF(
COUNT(1) = 0,
'ALTER TABLE app_virtual_order ADD INDEX idx_virtual_order_create_time (create_time)',
'SELECT 1'
)
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'app_virtual_order'
AND index_name = 'idx_virtual_order_create_time'
);
PREPARE dashboard_index_stmt FROM @dashboard_index_sql;
EXECUTE dashboard_index_stmt;
DEALLOCATE PREPARE dashboard_index_stmt;
SET @dashboard_index_sql = (
SELECT IF(
COUNT(1) = 0,
'ALTER TABLE app_pay_order ADD INDEX idx_pay_order_status_pay_time (status, pay_time)',
'SELECT 1'
)
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'app_pay_order'
AND index_name = 'idx_pay_order_status_pay_time'
);
PREPARE dashboard_index_stmt FROM @dashboard_index_sql;
EXECUTE dashboard_index_stmt;
DEALLOCATE PREPARE dashboard_index_stmt;
SET @dashboard_index_sql = (
SELECT IF(
COUNT(1) = 0,
'ALTER TABLE app_virtual_order ADD INDEX idx_virtual_order_status_pay_time (status, pay_time)',
'SELECT 1'
)
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'app_virtual_order'
AND index_name = 'idx_virtual_order_status_pay_time'
);
PREPARE dashboard_index_stmt FROM @dashboard_index_sql;
EXECUTE dashboard_index_stmt;
DEALLOCATE PREPARE dashboard_index_stmt;