diff --git a/Install.php b/Install.php index 433ea98..97a7623 100644 --- a/Install.php +++ b/Install.php @@ -3,6 +3,8 @@ namespace Plugins\Notebook; use App\Interfaces\PluginsInstallInterface; +use App\Model\Base\Route; +use App\Util\Hy; use Hyperf\DbConnection\Db; class Install implements PluginsInstallInterface @@ -10,7 +12,9 @@ class Install implements PluginsInstallInterface public static function run(): void { + $table = Route::getPrefix() . Route::table(); + // 添加菜单 - Db::insert("INSERT INTO `sd_module`.`sc_route` (`pid`, `type`, `title`, `icon`, `route`, `power_route`, `weigh`, `create_time`, `update_time`, `delete_time`) VALUES (0, 1, '笔记本', 'Document', '/admin/plugins/notebook/lists', NULL, 1, '2023-09-24 12:36:45', '2023-09-24 12:36:45', NULL);"); + Db::insert("INSERT INTO `$table` (`pid`, `type`, `title`, `icon`, `route`, `power_route`, `weigh`, `create_time`, `update_time`, `delete_time`) VALUES (0, 1, '笔记本', 'Document', '/admin/plugins/notebook/lists', NULL, 1, '2023-09-24 12:36:45', '2023-09-24 12:36:45', NULL);"); } } \ No newline at end of file diff --git a/Uninstall.php b/Uninstall.php new file mode 100644 index 0000000..f18f8bd --- /dev/null +++ b/Uninstall.php @@ -0,0 +1,14 @@ +