修改数据库

This commit is contained in:
邹景立 2022-10-27 13:47:36 +08:00
parent 804889743a
commit 3e6189ceb7
2 changed files with 10 additions and 4 deletions

View File

@ -26,10 +26,11 @@ class InstallWechatData extends Migrator
*/ */
private function createMenu() private function createMenu()
{ {
// 检查菜单数据
$map = ['node' => 'wechat/config/options']; $map = ['node' => 'wechat/config/options'];
if (SystemMenu::mk()->where($map)->count() > 0) { if (SystemMenu::mk()->where($map)->count() > 0) return;
return;
} // 写入微信菜单
ToolsExtend::write2menu([ ToolsExtend::write2menu([
[ [
'name' => '微信管理', 'name' => '微信管理',

View File

@ -9,9 +9,14 @@ use think\migration\Migrator;
*/ */
class InstallUserData extends Migrator class InstallUserData extends Migrator
{ {
/**
* @return void
* @throws \think\db\exception\DbException
*/
public function change() public function change()
{ {
$this->createMenu() && $this->createRegion(); $this->createMenu();
$this->createRegion();
} }
/** /**