链接管理模块

This commit is contained in:
root
2026-06-03 12:10:25 +08:00
parent 4aec0b4fce
commit 907d78b3aa
38 changed files with 3805 additions and 1 deletions
+16 -1
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace app\common\model;
use think\Model;
@@ -92,12 +94,25 @@ class Config extends Model
}
/**
* 读取分类分组列表
* 读取分类分组列表(优先数据库 configgroup,避免 site.php 未同步时分组缺失)
*
* @return array
*/
public static function getGroupList()
{
$groupList = config('site.configgroup');
if (!is_array($groupList)) {
$groupList = [];
}
try {
$dbJson = \think\Db::name('config')->where('name', 'configgroup')->value('value');
$dbList = json_decode((string) $dbJson, true);
if (is_array($dbList) && $dbList !== []) {
$groupList = $dbList;
}
} catch (\Throwable $e) {
// 数据库不可用时回退 site.php
}
foreach ($groupList as $k => &$v) {
$v = __($v);
}