1.优化常规配置/admin/config/gameConfig新增派彩时间设置
2.修复后台翻译问题
This commit is contained in:
@@ -455,25 +455,28 @@ if (!function_exists('get_route_remark')) {
|
||||
function get_route_remark(): string
|
||||
{
|
||||
$controllerPath = get_controller_path() ?? '';
|
||||
$actionName = '';
|
||||
if (function_exists('request')) {
|
||||
$req = request();
|
||||
if ($req) {
|
||||
$path = trim($req->path(), '/');
|
||||
$parts = explode('/', $path);
|
||||
$actionName = $parts[array_key_last($parts)] ?? '';
|
||||
}
|
||||
if ($controllerPath === '') {
|
||||
return '';
|
||||
}
|
||||
$path = str_replace('.', '/', $controllerPath);
|
||||
$names = [$path];
|
||||
if ($actionName) {
|
||||
$names[] = $path . '/' . $actionName;
|
||||
$menuNames = [$path];
|
||||
$parts = explode('/', $path);
|
||||
foreach ($parts as &$part) {
|
||||
if (str_contains($part, '_')) {
|
||||
$part = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $part))));
|
||||
}
|
||||
}
|
||||
unset($part);
|
||||
$camelPath = implode('/', $parts);
|
||||
if ($camelPath !== $path) {
|
||||
$menuNames[] = $camelPath;
|
||||
}
|
||||
$remark = \support\think\Db::name('admin_rule')
|
||||
->where('name', 'in', $names)
|
||||
->where('name', 'in', array_values(array_unique($menuNames)))
|
||||
->where('type', 'in', ['menu', 'menu_dir'])
|
||||
->value('remark');
|
||||
$remarkStr = (string) ($remark ?? '');
|
||||
if (!$remarkStr) {
|
||||
if ($remarkStr === '') {
|
||||
return '';
|
||||
}
|
||||
return function_exists('trans') ? trans($remarkStr, [], $controllerPath ?: null) : $remarkStr;
|
||||
|
||||
Reference in New Issue
Block a user