diff --git a/database/migrations/20221013045830_install_wechat_data.php b/database/migrations/20221013045830_install_wechat_data.php index 9df69b623..8246dea18 100644 --- a/database/migrations/20221013045830_install_wechat_data.php +++ b/database/migrations/20221013045830_install_wechat_data.php @@ -26,10 +26,11 @@ class InstallWechatData extends Migrator */ private function createMenu() { + // 检查菜单数据 $map = ['node' => 'wechat/config/options']; - if (SystemMenu::mk()->where($map)->count() > 0) { - return; - } + if (SystemMenu::mk()->where($map)->count() > 0) return; + + // 写入微信菜单 ToolsExtend::write2menu([ [ 'name' => '微信管理', diff --git a/database/migrations/20221013045839_install_user_data.php b/database/migrations/20221013045839_install_user_data.php index 802844863..f8d2817ae 100644 --- a/database/migrations/20221013045839_install_user_data.php +++ b/database/migrations/20221013045839_install_user_data.php @@ -9,9 +9,14 @@ use think\migration\Migrator; */ class InstallUserData extends Migrator { + /** + * @return void + * @throws \think\db\exception\DbException + */ public function change() { - $this->createMenu() && $this->createRegion(); + $this->createMenu(); + $this->createRegion(); } /**