diff --git a/stc/database/20250621000001_install_staff_menu.php b/stc/database/20250621000001_install_staff_menu.php new file mode 100644 index 0000000..b14ccbe --- /dev/null +++ b/stc/database/20250621000001_install_staff_menu.php @@ -0,0 +1,54 @@ +<?php + + +use jerryyan\staff\Service; +use think\admin\extend\PhinxExtend; +use think\migration\Migrator; + +@set_time_limit(0); +@ini_set('memory_limit', -1); + +/** + * 系统模块数据 + */ +class InstallStaffMenu extends Migrator +{ + + /** + * 获取脚本名称 + * @return string + */ + public function getName(): string + { + return 'StaffPlugin'; + } + + + /** + * 创建数据库 + */ + public function change() + { + $this->insertMenu(); + } + + /** + * 初始化系统菜单 + * @return void + * @throws \Exception + */ + private function insertMenu() + { + + // 初始化菜单数据 + PhinxExtend::write2menu([ + [ + 'name' => '组织架构', + 'sort' => '101', + 'subs' => Service::menu(), + ], + ], [ + 'url|node' => 'staff/user/index' + ]); + } +} \ No newline at end of file