diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index e446f8eab..f504d129e 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -42,7 +42,7 @@ class Auth extends Controller { SystemAuth::mQuery()->layTable(function () { $this->title = '系统权限管理'; - }, function (QueryHelper $query) { + }, static function (QueryHelper $query) { $query->like('title,desc')->equal('status,utype')->dateBetween('create_at'); }); } @@ -96,9 +96,7 @@ class Auth extends Controller $map = $this->_vali(['auth.require#id' => '权限ID不能为空!']); if (input('action') === 'get') { if ($this->app->isDebug()) AdminService::clear(); - $nodes = SystemNode::mk()->where($map)->column('node'); - foreach ($nodes as &$node) $node['title'] = lang($node['title']); - $ztree = AdminService::getTree($nodes); + $ztree = AdminService::getTree(SystemNode::mk()->where($map)->column('node')); usort($ztree, static function ($a, $b) { if (explode('-', $a['node'])[0] !== explode('-', $b['node'])[0]) { if (stripos($a['node'], 'plugin-') === 0) return 1; diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index 50eba9e99..5408df666 100644 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -41,7 +41,7 @@ class Base extends Controller $this->title = '数据字典管理'; $this->types = SystemBase::types(); $this->type = $this->get['type'] ?? ($this->types[0] ?? '-'); - }, function (QueryHelper $query) { + }, static function (QueryHelper $query) { $query->where(['deleted' => 0])->equal('type'); $query->like('code,name,status')->dateBetween('create_at'); }); diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 4cc94b075..c74043cc3 100644 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -57,9 +57,10 @@ class Config extends Controller $this->title = '系统参数配置'; $this->files = Storage::types(); $this->super = AdminService::isSuper(); - $this->version = ModuleService::getVersion(); $this->plugins = Plugin::get('', true); - uasort($this->plugins, function ($a, $b) { + $this->version = ModuleService::getVersion(); + $this->framework = ModuleService::getLibrarys('topthink/framework'); + uasort($this->plugins, static function ($a, $b) { if ($a['space'] === $b['space']) return 0; return $a['space'] > $b['space'] ? 1 : -1; }); diff --git a/app/admin/controller/File.php b/app/admin/controller/File.php index c93977880..a34e3133b 100644 --- a/app/admin/controller/File.php +++ b/app/admin/controller/File.php @@ -57,7 +57,7 @@ class File extends Controller SystemFile::mQuery()->layTable(function () { $this->title = '系统文件管理'; $this->xexts = SystemFile::mk()->distinct()->column('xext'); - }, function (QueryHelper $query) { + }, static function (QueryHelper $query) { $query->like('name,hash,xext')->equal('type')->dateBetween('create_at'); $query->where(['issafe' => 0, 'status' => 2, 'uuid' => AdminService::getUserId()]); }); diff --git a/app/admin/controller/Oplog.php b/app/admin/controller/Oplog.php index 28039b72c..f565a7a70 100644 --- a/app/admin/controller/Oplog.php +++ b/app/admin/controller/Oplog.php @@ -44,7 +44,7 @@ class Oplog extends Controller $columns = SystemOplog::mk()->column('action,username', 'id'); $this->users = array_unique(array_column($columns, 'username')); $this->actions = array_unique(array_column($columns, 'action')); - }, function (QueryHelper $query) { + }, static function (QueryHelper $query) { $query->dateBetween('create_at')->equal('username,action')->like('content,geoip,node'); }); } diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index d72599be7..2302ded10 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -50,7 +50,7 @@ class Queue extends Controller $this->command = "sudo -u {$_SERVER['USER']} {$this->command}"; } } - }, function (QueryHelper $query) { + }, static function (QueryHelper $query) { $query->equal('status')->like('code|title#title,command'); $query->timeBetween('enter_time,exec_time')->dateBetween('create_at'); }); @@ -68,7 +68,7 @@ class Queue extends Controller protected function _index_page_filter(array $data, array &$result) { $result['extra'] = ['dos' => 0, 'pre' => 0, 'oks' => 0, 'ers' => 0]; - SystemQueue::mk()->field('status,count(1) count')->group('status')->select()->map(function ($item) use (&$result) { + SystemQueue::mk()->field('status,count(1) count')->group('status')->select()->map(static function ($item) use (&$result) { if (intval($item['status']) === 1) $result['extra']['pre'] = $item['count']; if (intval($item['status']) === 2) $result['extra']['dos'] = $item['count']; if (intval($item['status']) === 3) $result['extra']['oks'] = $item['count']; diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 0ea78aa0e..186e3d89a 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -41,7 +41,6 @@ class User extends Controller public function index() { $this->type = $this->get['type'] ?? 'index'; - // 创建快捷查询工具 SystemUser::mQuery()->layTable(function () { $this->title = '系统用户管理'; $this->bases = SystemBase::items('身份权限'); @@ -51,9 +50,9 @@ class User extends Controller $query->where(['is_deleted' => 0, 'status' => intval($this->type === 'index')]); // 关联用户身份资料 - $query->with(['userinfo' => function ($relation) { - /** @var \think\model\Relation|\think\db\Query $relation */ - $relation->field('code,name,content'); + /** @var \think\model\Relation|\think\db\Query $query */ + $query->with(['userinfo' => static function ($query) { + $query->field('code,name,content'); }]); // 数据列表搜索过滤 diff --git a/app/admin/controller/api/System.php b/app/admin/controller/api/System.php index 6fd546312..b91a4a4c8 100644 --- a/app/admin/controller/api/System.php +++ b/app/admin/controller/api/System.php @@ -118,7 +118,7 @@ class System extends Controller foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) { $newdata[] = ['type' => $type, 'name' => $name, 'value' => $value]; } - $this->app->db->transaction(function () use ($newdata) { + $this->app->db->transaction(static function () use ($newdata) { SystemConfig::mQuery()->empty()->insertAll($newdata); }); $this->app->cache->delete('SystemConfig'); diff --git a/app/admin/route/demo.php b/app/admin/route/demo.php index 0452a4f1d..4298a8222 100644 --- a/app/admin/route/demo.php +++ b/app/admin/route/demo.php @@ -19,34 +19,34 @@ use think\admin\service\RuntimeService; /*! 演示环境禁止操作路由绑定 */ if (RuntimeService::check('demo')) { - Library::$sapp->route->post('index/pass', function () { + Library::$sapp->route->post('index/pass', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止修改用户密码!')]); }); - Library::$sapp->route->post('config/system', function () { + Library::$sapp->route->post('config/system', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止修改系统配置!')]); }); - Library::$sapp->route->post('config/storage', function () { + Library::$sapp->route->post('config/storage', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止修改系统配置!')]); }); - Library::$sapp->route->post('menu', function () { + Library::$sapp->route->post('menu', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止给菜单排序!')]); }); - Library::$sapp->route->post('menu/index', function () { + Library::$sapp->route->post('menu/index', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止给菜单排序!')]); }); - Library::$sapp->route->post('menu/add', function () { + Library::$sapp->route->post('menu/add', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止添加菜单!')]); }); - Library::$sapp->route->post('menu/edit', function () { + Library::$sapp->route->post('menu/edit', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止编辑菜单!')]); }); - Library::$sapp->route->post('menu/state', function () { + Library::$sapp->route->post('menu/state', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止禁用菜单!')]); }); - Library::$sapp->route->post('menu/remove', function () { + Library::$sapp->route->post('menu/remove', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止删除菜单!')]); }); - Library::$sapp->route->post('user/pass', function () { + Library::$sapp->route->post('user/pass', static function () { return json(['code' => 0, 'info' => lang('演示环境禁止修改密码!')]); }); } \ No newline at end of file diff --git a/app/admin/view/config/index.html b/app/admin/view/config/index.html index 857de5719..66d1c8c16 100644 --- a/app/admin/view/config/index.html +++ b/app/admin/view/config/index.html @@ -14,7 +14,7 @@
{:lang('本地服务器存储')}:{:lang('文件上传到本地服务器的 `static/upload` 目录,不支持大文件上传,占用服务器磁盘空间,访问时消耗服务器带宽流量。')}
{:lang('自建Alist存储')}:{:lang('文件上传到 Alist 存储的服务器或云存储空间,根据服务配置可支持大文件上传,不占用本身服务器空间及服务器带宽流量。')}
{:lang('七牛云对象存储')}:{:lang('文件上传到七牛云存储空间,支持大文件上传,不占用服务器空间及服务器带宽流量,支持 CDN 加速访问,访问量大时推荐使用。')}
@@ -86,7 +86,7 @@{:lang('核心框架')} | -ThinkPHP Version {$app->version()} | +ThinkPHP Version {$framework.version|default='None'} |
{:lang('平台框架')} | @@ -176,7 +176,7 @@ {notempty name='plugins'}