diff --git a/admin/actions.php b/admin/actions.php
index 535f3ac..5de9c9e 100644
--- a/admin/actions.php
+++ b/admin/actions.php
@@ -210,6 +210,20 @@ try {
move_sort('groups', post_id(), (string)($_POST['dir'] ?? 'up'), null);
break;
}
+ case 'group_reorder': {
+ // 拖拽排序落库:板块没有分组维度(全表一套顺序),无需归属校验 ——
+ // apply_sort_order() 不带 $groupId 时按给定 id 顺序整组重写。
+ // 表单字段 `order` = 逗号分隔的 group id(按新顺序)。
+ $ids = [];
+ foreach (explode(',', (string)($_POST['order'] ?? '')) as $one) {
+ $one = (int)trim($one);
+ if ($one > 0) { $ids[] = $one; }
+ }
+ $n = apply_sort_order('groups', $ids);
+ $ajax = ['count' => $n];
+ if (!$isAjax) { flash('已保存排序(' . $n . ' 项)'); }
+ break;
+ }
/* ---------- 搜索引擎 ---------- */
case 'engine_save': {
diff --git a/admin/index.php b/admin/index.php
index cf13eb9..4493dee 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -191,7 +191,7 @@ if ($p === 'sites'):
data-group-id="= $gid ?>">
| 简称(展示) | 名称 | 网址 | 显示 | 微调 | 操作 |
-
+
| = drag_handle() ?> |
@@ -251,11 +251,18 @@ elseif ($p === 'groups'): ?>
-
- | 名称 | 展示方式 | 网站数 | 显示 | 排序 | 操作 |
-
+ 板块列表(= count($groups) ?>)
+
+ 板块的先后顺序就是它们在前台出现的顺序:按住某一行拖动即可调整,松手即保存;
+ 也可以用每行右侧的 ↑ ↓ 微调(不支持拖拽的环境用)。
+ 新添加的板块一律排在最后,直到你手动把它拖到别处。
+
+
+ | 名称 | 展示方式 | 网站数 | 显示 | 微调 | 操作 |
+
query('SELECT COUNT(*) FROM sites WHERE group_id=' . (int)$g['id'])->fetchColumn(); ?>
-
+
+ | = drag_handle() ?> |
= e($g['name']) ?> |
= $g['display'] === 'tabs' ? '合集标签页' : '普通网格' ?> |
= $cnt ?> |
@@ -272,6 +279,7 @@ elseif ($p === 'groups'): ?>
+