feat: configure hot leagues in match center

This commit is contained in:
hajimi
2026-08-02 02:50:40 +08:00
parent 3e95fad23f
commit 163df0cf85
11 changed files with 109 additions and 67 deletions
+17
View File
@@ -0,0 +1,17 @@
-- 联赛管理增加“热门联赛”配置字段,可重复执行。
SET @schema_name = DATABASE();
SET @has_is_hot = (
SELECT COUNT(*)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @schema_name
AND TABLE_NAME = 'la_league'
AND COLUMN_NAME = 'is_hot'
);
SET @alter_sql = IF(
@has_is_hot = 0,
'ALTER TABLE `la_league` ADD COLUMN `is_hot` tinyint unsigned NOT NULL DEFAULT 0 COMMENT ''是否热门联赛: 0=否 1=是'' AFTER `is_show`',
'SELECT ''la_league.is_hot already exists'''
);
PREPARE alter_stmt FROM @alter_sql;
EXECUTE alter_stmt;
DEALLOCATE PREPARE alter_stmt;
+1
View File
@@ -16,6 +16,7 @@ CREATE TABLE `la_league` (
`icon` varchar(500) NOT NULL DEFAULT '' COMMENT '联赛图标 URL',
`sort` int NOT NULL DEFAULT 0 COMMENT '排序权重(越小越靠前)',
`is_show` tinyint unsigned NOT NULL DEFAULT 1 COMMENT '是否显示: 0=隐藏 1=显示',
`is_hot` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '是否热门联赛: 0=否 1=是',
`extra_data` json DEFAULT NULL COMMENT '额外数据(如 calendar 等)',
`create_time` int unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
`update_time` int unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',